Documentation ¶
Overview ¶
Package config provides types and methods used for interacting the service configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Version defines the configuration version. Version int `toml:"version"` // Postgres defines the PostgreSQL database configuration. Postgres PostgresConfig `toml:"postgres"` // Server defines the HTTP server configuration. Server ServerConfig `toml:"server"` }
Config defines the service configuration.
func LoadConfig ¶
LoadConfig loads configuration from the provided path.
type PostgresConfig ¶
type PostgresConfig struct { Host string `toml:"host"` Port int `toml:"port"` MaxOpenedConnections int `toml:"max_opened_connections"` Database string `toml:"database"` Username string `toml:"username"` Password string `toml:"password"` SslMode string `toml:"ssl_mode"` }
PostgresConfig defines the services database configuration.
type ServerConfig ¶
type ServerConfig struct { Listen string `toml:"listen"` ResponseWriteTimeoutDuration duration `toml:"response_write_timeout_duration"` RequestReadTimeoutDuration duration `toml:"request_read_timeout_duration"` ShutdownTimeoutDuration duration `toml:"shutdown_timeout_duration"` }
ServerConfig defines the HTTP server configuration.
Click to show internal directories.
Click to hide internal directories.