Documentation
¶
Overview ¶
Package cfg - Because hardcoding values is for people who live dangerously, and we're too scared for that
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
LogLevel logger.LogLevel // How much spam you want in your logs
LogFile string // Where your logs go to die
ShutdownTimeout time.Duration // How long before we kill it with fire
RetryConfig retry.Config // For when at first you don't succeed
EnableColors bool // Making logs pretty won't fix your bugs
}
Config holds all the knobs you can tweak until your application breaks
func Configure ¶
func Configure(opts ...ConfigOption) *Config
Configure applies your questionable configuration choices Returns a Config that you'll probably need to change later anyway
func (*Config) ColorsEnabled ¶
ColorsEnabled - Are we in fancy mode?
func (*Config) GetLogLevel ¶
GetLogLevel - In case you forgot what you configured 5 minutes ago
func (*Config) GetRetryConfig ¶
GetRetryConfig - Returns your optimistic retry settings
func (*Config) GetShutdownTimeout ¶
GetShutdownTimeout - How long until we give up and kill -9
type ConfigOption ¶
type ConfigOption func(*Config)
ConfigOption - Because global variables are evil, but function pointers are fine
func WithColors ¶
func WithColors(enable bool) ConfigOption
WithColors - Because monochrome logs are depressing enough already
func WithLogFile ¶
func WithLogFile(file string) ConfigOption
WithLogFile - Because printing to stdout is so 1970s
func WithLogLevel ¶
func WithLogLevel(level logger.LogLevel) ConfigOption
WithLogLevel - For when you want to see more (or less) of your mistakes
func WithRetryConfig ¶
func WithRetryConfig(config retry.Config) ConfigOption
WithRetryConfig - Configure your retry strategy, as if the first attempt wasn't bad enough
func WithShutdownTimeout ¶
func WithShutdownTimeout(timeout time.Duration) ConfigOption
WithShutdownTimeout - How patient are you really?