Categorygithub.com/Falokut/admin_casts_service
module
0.0.0-20240318122104-abe6acf826f2
Repository: https://github.com/falokut/admin_casts_service.git
Documentation: pkg.go.dev

# README

Admin casts service

Go Report Card go.dev reference GitHub go.mod Go version Go License

Content


Configuration

  1. Configure casts_db
  2. Create .env on project root dir
    Example env:
DB_PASSWORD=Password
  1. Create a configuration file or change the config.yml file in docker\containers-configs. If you are creating a new configuration file, specify the path to it in docker-compose volume section (your-path/config.yml:configs/)

Configuration params info

if supported values is empty, then any type values are supported

yml nameyml sectionenv nameparam typedescriptionsupported values
log_levelLOG_LEVELstringlogging levelpanic, fatal, error, warning, warn, info, debug, trace
healthcheck_portHEALTHCHECK_PORTstringport for healthcheckany valid port that is not occupied by other services. The string should not contain delimiters, only the port number
hostlistenHOSTstringip address or host to listen
portlistenPORTstringport to listenThe string should not contain delimiters, only the port number
server_modelistenSERVER_MODEstringServer listen mode, Rest API, gRPC or bothGRPC, REST, BOTH
allowed_headerslisten[]string, array of stringslist of all allowed custom headers. Need for REST API gateway, list of metadata headers, hat are passed through the gateway into the serviceany strings list
service_nameprometheusPROMETHEUS_SERVICE_NAMEstringservice name, thats will show in prometheus
server_configprometheusnested yml configuration metrics server config
addrmovies_serviceMOVIES_SERVICE_ADDRESSstringaddress of the movies service
connection_configmovies_servicenested yml configuration secure connection config
addrmovies_persons_serviceMOVIES_PERSONS_SERVICE_ADDRESSstringaddress of the movies service
connection_configmovies_persons_servicenested yml configuration secure connection config
db_confignested yml configuration database configconfiguration for database connection
jaegernested yml configuration jaeger configconfiguration for jaeger connection
kafka_events_confignested yml configuration kafka reader configconfiguration for kafka connection

Database config

yml nameenv nameparam typedescriptionsupported values
hostDB_HOSTstringhost or ip address of database
portDB_PORTstringport of databaseany valid port that is not occupied by other services. The string should not contain delimiters, only the port number
usernameDB_USERNAMEstringusername(role) in database
passwordDB_PASSWORDstringpassword for role in database
db_nameDB_NAMEstringdatabase name (database instance)
ssl_modeDB_SSL_MODEstringenable or disable ssl mode for database connectiondisabled or enabled

Jaeger config

yml nameenv nameparam typedescriptionsupported values
addressJAEGER_ADDRESSstringip address(or host) with port of jaeger serviceall valid addresses formatted like host:port or ip-address:port
service_nameJAEGER_SERVICE_NAMEstringservice name, thats will show in jaeger in traces
log_spansJAEGER_LOG_SPANSboolwhether to enable log scans in jaeger for this service or not

Prometheus config

yml nameenv nameparam typedescriptionsupported values
hostMETRIC_HOSTstringip address or host to listen for prometheus service
portMETRIC_PORTstringport to listen for of prometheus serviceany valid port that is not occupied by other services. The string should not contain delimiters, only the port number

Kafka reader config

yml nameenv nameparam typedescriptionsupported values
brokers[]string, array of stringslist of all kafka brokers
group_idstringid or name for consumer group
read_batch_timeouttime.Duration with positive durationamount of time to wait to fetch message from kafka messages batchsupported values

time.Duration yaml supported values

A Duration value can be expressed in various formats, such as in seconds, minutes, hours, or even in nanoseconds. Here are some examples of valid Duration values:

  • 5s represents a duration of 5 seconds.
  • 1m30s represents a duration of 1 minute and 30 seconds.
  • 2h represents a duration of 2 hours.
  • 500ms represents a duration of 500 milliseconds.
  • 100µs represents a duration of 100 microseconds.
  • 10ns represents a duration of 10 nanoseconds.

Secure connection config

yml nameparam typedescriptionsupported values
dial_methodstringdial methodINSECURE,INSECURE_SKIP_VERIFY,CLIENT_WITH_SYSTEM_CERT_POOL
server_namestringserver name overriding, used when dial_method=CLIENT_WITH_SYSTEM_CERT_POOL

Metrics

The service uses Prometheus and Jaeger and supports distribution tracing

Docs

Swagger docs

Author

  • @Falokut - Primary author of the project

License

This project is licensed under the terms of the MIT License.


# Packages

No description provided by the author
No description provided by the author