Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { EventPollingPeriod time.Duration `envconfig:"EVENT_POLLING_PERIOD" default:"200ms"` Health HealthConfig `envconfig:"HEALTH"` Stream StreamConfig `envconfig:"STREAM"` Database DBConfig `envconfig:"DB"` }
Config represents service configurations.
func LoadConfig ¶
LoadConfig returns parsed from environment variables service configuration.
type DBConfig ¶
type DBConfig struct { Host string `envconfig:"HOST"` Port int `envconfig:"PORT" default:"5432"` Name string `envconfig:"NAME" default:"payments"` User string `envconfig:"USER"` Password string `encconfig:"PASSWORD"` Pool *PoolConfig `envconfig:"POOL"` }
DBConfig represents database connection configuration.
type HealthConfig ¶
type HealthConfig struct { Port int `envconfig:"PORT" default:"6062"` LiveEndpoint string `envconfig:"LIVINESS_ENDPOINT" default:"/livez"` ReadyEndpoint string `envconfig:"READINESS_ENDPOINT" default:"/ready"` Period time.Duration `envconfig:"PERIOD" default:"3s"` GracePeriod time.Duration `envconfig:"GRACE_PERIOD" default:"30s"` }
HealthConfig represents health controller configuration.
type PoolConfig ¶
type PoolConfig struct { MaxOpenConns int `envconfig:"MAX_OPEN_CONNS" default:"20"` MaxIdleConns int `envconfig:"MAX_IDLE_CONNS" default:"20"` }
PoolConfig represents databese connection pool configuration.
type StreamConfig ¶
type StreamConfig struct { Host string `envconfig:"HOST"` Port int `envconfig:"PORT" default:"6379"` }
StreamConfig represents stream connection configuration.
func (StreamConfig) Addr ¶
func (c StreamConfig) Addr() string
Click to show internal directories.
Click to hide internal directories.