Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Consul Consul `mapstructure:",squash"` HTTP HTTP `mapstructure:",squash"` GRPC GRPC `mapstructure:",squash"` PubSub PubSub `mapstructure:",squash"` PProf Pprof `mapstructure:",squash"` Postgres PostgresDatabase `mapstructure:",squash"` Redis Redis `mapstructure:",squash"` }
Config project config.
func InitConfig ¶
func InitConfig() Config
InitConfig initializes configuration from .env file and returns config structure.
func (Config) IsValidGRPC ¶
func (Config) IsValidHTTP ¶
func (Config) IsValidSubscriber ¶
type Consul ¶
type Consul struct { Host string `mapstructure:"CONSUL_HOST"` Port int `mapstructure:"CONSUL_PORT"` Token string `mapstructure:"CONSUL_HTTP_TOKEN"` // RuntimeConfig settings Key string `mapstructure:"CONSUL_KEY"` RefreshInterval time.Duration `mapstructure:"CONSUL_REFRESH_INTERVAL"` }
Consul contains consul remote config related values.
type GRPC ¶
type GRPC struct {
Port int `mapstructure:"GRPC_PORT"`
}
GRPC contains GRPC related configuration.
type HTTP ¶
type HTTP struct { Port int `mapstructure:"HTTP_PORT"` GracefulDuration time.Duration `mapstructure:"HTTP_GRACEFUL_DURATION"` }
HTTP contains HTTP related configuration.
type PostgresDatabase ¶
type PostgresDatabase struct { DSN string `mapstructure:"DB_POSTGRES_DSN"` LogLevel logger.LogLevel `mapstructure:"DB_POSTGRES_LOG_LEVEL"` MaxOpenConnections int `mapstructure:"DB_POSTGRES_MAX_OPEN_CONNECTIONS"` MaxIdleConnections int `mapstructure:"DB_POSTGRES_MAX_IDLE_CONNECTIONS"` MaxConnectionLifetime time.Duration `mapstructure:"DB_POSTGRES_MAX_CONNECTIONS_LIFETIME"` }
PostgresDatabase contains postgres configuration.
type Pprof ¶
type Pprof struct { Enabled bool `mapstructure:"PPROF_ENABLED"` Port int `mapstructure:"PPROF_PORT"` }
Pprof contains Pprof project configuration.
Click to show internal directories.
Click to hide internal directories.