Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Service ServiceConfig HttpServer HttpServerConfig }
type HttpServerConfig ¶
type HttpServerConfig struct { Hostname string `toml:"hostname" env:"HTTPSERVER_HOSTNAME" env-required` HostPort int `toml:"host_port" env:"HTTPSERVER_HOST_PORT" env-required` ReadHeaderTimeout StrTimeDuration `toml:"read_header_timeout_duration" env:"HTTPSERVER_READ_HEADER_TIMEOUT_DURATION" env-required` WriteTimeout StrTimeDuration `toml:"write_timeout_duration" env:"HTTPSERVER_WRITE_TIMEOUT_DURATION" env-required` }
type ServiceConfig ¶
type ServiceConfig struct {
TimeBetweenJobProcesses StrTimeDuration `toml:"time_between_job_processes" env:"QUEUE_MGR_TIME_BTW_JOB_PROCESSES" env-required`
}
type StrTimeDuration ¶
type StrTimeDuration string
Purpose: 1) Reap the benefit of being able to use time duration string format in config variables. 2) Validate format when parsing the config file / env var and not having to do it always before passing each value of the type to a builder or contructor func.
func (*StrTimeDuration) GetDuration ¶
func (d *StrTimeDuration) GetDuration() time.Duration
func (*StrTimeDuration) SetValue ¶
func (d *StrTimeDuration) SetValue(s string) error
Implements Setter interface needed by library cleanenv to set the custom type
Click to show internal directories.
Click to hide internal directories.