Documentation
¶
Overview ¶
Package config provides a singleton instance of the configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CORS ¶
type CORS struct {
AllowOrigins []string `envconfig:"CORS_ALLOW_ORIGINS" required:"true"`
}
CORS is the configuration for the CORS.
type Config ¶
type Config struct { Environment EnvType `envconfig:"ENVIRONMENT" required:"true"` HTTP HTTP Postgres Postgres Logger Logger Token Token CORS CORS }
Config is the configuration for the application.
type HTTP ¶
type HTTP struct { Host string `envconfig:"HTTP_HOST" required:"true"` Port string `envconfig:"HTTP_PORT" required:"true"` MaxHeaderBytes int `envconfig:"HTTP_MAX_HEADER_BYTES" default:"1"` ReadTimeout time.Duration `envconfig:"HTTP_READ_TIMEOUT" default:"10s"` WriteTimeout time.Duration `envconfig:"HTTP_WRITE_TIMEOUT" default:"10s"` }
HTTP is the configuration for the HTTP server.
type Logger ¶
type Logger struct {
Level string `envconfig:"LOGGER_LEVEL" default:"info"`
}
Logger is the configuration for the logger.
type Postgres ¶
type Postgres struct { Host string `envconfig:"POSTGRES_HOST" required:"true"` Port string `envconfig:"POSTGRES_PORT" required:"true"` DBName string `envconfig:"POSTGRES_DBNAME" required:"true"` User string `envconfig:"POSTGRES_USER" required:"true"` Password string `envconfig:"POSTGRES_PASSWORD" required:"true" json:"-"` SSLMode string `envconfig:"POSTGRES_SSLMODE" default:"disable"` }
Postgres is the configuration for the Postgres database.
Click to show internal directories.
Click to hide internal directories.