Documentation ¶
Index ¶
Constants ¶
View Source
const ( EnvLocal Environment = "local" EnvTest Environment = "test" EnvDev Environment = "dev" EnvStaging Environment = "staging" EnvLT Environment = "lt" EnvQA Environment = "qa" EnvProd Environment = "prod" StorageLocal Storage = "local" StorageDynamoDB Storage = "dynamodb" LvlDbg LogLevel = "debug" LvlInfo LogLevel = "info" LvlWarn LogLevel = "warn" LvlErr LogLevel = "error" )
Variables ¶
This section is empty.
Functions ¶
func SwitchEnvironment ¶
func SwitchEnvironment(env Environment)
SwitchEnvironment sets the environment variable used to dictate which environment the application is currently running in. This must be called prior to loading the configuration in order for it to take effect.
Types ¶
type AWS ¶
type AWS struct { AccessKeyID string `env:"AWS_ACCESS_KEY_ID"` Secret string `env:"AWS_SECRET_ACCESS_KEY"` Region string `env:"AWS_REGION"` Endpoint string `env:"AWS_ENDPOINT"` AWSCfg aws.Config }
AWS defines the configs related to AWS services.
type App ¶
type App struct { Name string `env:"APP_NAME,default=backfill"` Environment Environment `env:"APP_ENVIRONMENT,default=local"` LogLevel LogLevel `env:"LOG_LEVEL,default=info"` Timeout time.Duration `env:"APP_TIMEOUT,default=20s"` Storage Storage `env:"APP_STORAGE,default=local"` }
App defines the configs needed for the application itself.
type Config ¶
Config is the aggregation of all necessary configurations.
type DynamoDB ¶
type DynamoDB struct {
ItemTable string `env:"DYNAMODB_ITEM_TABLE"`
}
DynamoDB defines the configs related specfically to the DynamoDB service.
type Environment ¶
type Environment string
type HTTP ¶
type HTTP struct { Hostname string `env:"HTTP_HOSTNAME,default=0.0.0.0"` Port uint16 `env:"HTTP_PORT,default=8000"` ReadTimeout time.Duration `env:"HTTP_READ_TIMEOUT,default=5s"` WriteTimeout time.Duration `env:"HTTP_WRITE_TIMEOUT,default=10s"` IdleTimeout time.Duration `env:"HTTP_IDLE_TIMEOUT,default=2m"` TLS struct { Enabled bool `env:"HTTP_TLS_ENABLED,default=false"` Certificate string `env:"HTTP_TLS_CERTIFICATE"` Key string `env:"HTTP_TLS_KEY"` } }
HTTP stores the configuration for the HTTP server.
Click to show internal directories.
Click to hide internal directories.