Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultPort = "8080" DefaultLogLevel = "info" DefDatabase = "ecommerce" DefEnvironment = "local" DefDBQueryLogging = false DefEnableTracing = false )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceEnvConfig ¶
type ServiceEnvConfig struct {
Environment string // environment where this service is running (dev, staging, prod, etc.)
Port string // port on which this service runs, defaults to DefaultPort
LogLevel string // logger level for the service
// DB related configurations
DBCredentialsSideCar string // path to find the database credentials sidecar file
DBHosts string // comma separated list of DB hosts
DBName string // name of the database
DBPort int // port on which the DB is listening, defaults to 27017
DBLogQueries bool // print the DB queries that are triggered through this service, defaults to false
DisableAuth bool // disables API authentication, added to make local development/testing easy
EnableTracing bool // enables flight recorder for slow request tracing, defaults to false
}
ServiceEnvConfig holds all environmental configurations for the service.
func Load ¶
func Load() (*ServiceEnvConfig, error)
Load reads all environmental configurations and returns a ServiceEnvConfig.
Click to show internal directories.
Click to hide internal directories.