Documentation
¶
Index ¶
- Constants
- Variables
- func Bool(b bool) *bool
- func BoolGoString(b *bool) string
- func BoolPresent(b *bool) bool
- func BoolVal(b *bool) bool
- func ConsulStringToStructFunc() mapstructure.DecodeHookFunc
- func FileMode(o os.FileMode) *os.FileMode
- func FileModeGoString(o *os.FileMode) string
- func FileModePresent(o *os.FileMode) bool
- func FileModeVal(o *os.FileMode) os.FileMode
- func Int(i int) *int
- func IntGoString(i *int) string
- func IntPresent(i *int) bool
- func IntVal(i *int) int
- func Signal(s os.Signal) *os.Signal
- func SignalGoString(s *os.Signal) string
- func SignalPresent(s *os.Signal) bool
- func SignalVal(s *os.Signal) os.Signal
- func String(s string) *string
- func StringGoString(s *string) string
- func StringPresent(s *string) bool
- func StringToFileModeFunc() mapstructure.DecodeHookFunc
- func StringVal(s *string) string
- func TimeDuration(t time.Duration) *time.Duration
- func TimeDurationGoString(t *time.Duration) string
- func TimeDurationPresent(t *time.Duration) bool
- func TimeDurationVal(t *time.Duration) time.Duration
- type AuthConfig
- type Config
- type ConsulConfig
- type EnvConfig
- type RetryConfig
- type RetryFunc
- type SSLConfig
- type SyslogConfig
- type TransportConfig
Constants ¶
View Source
const ( DefaultLogLevel = "WARN" DefaultReloadSignal = syscall.SIGHUP DefaultKillSignal = syscall.SIGINT )
View Source
const ( DefaultRetryAttempts = 12 DefaultRetryBackoff = 250 * time.Millisecond DefaultRetryMaxBackoff = 1 * time.Minute )
View Source
const ( DefaultDialKeepAlive = 30 * time.Second DefaultDialTimeout = 30 * time.Second DefaultIdleConnTimeout = 90 * time.Second DefaultMaxIdleConns = 100 DefaultTLSHandshakeTimeout = 10 * time.Second )
View Source
const (
DefaultSSLVerify = true
)
View Source
const (
DefaultSyslogFacility = "LOCAL0"
)
Variables ¶
View Source
var (
DefaultMaxIdleConnsPerHost = runtime.GOMAXPROCS(0) + 1
)
View Source
var (
ErrAuthStringEmpty = errors.New("auth: cannot be empty")
)
Functions ¶
func BoolGoString ¶
func BoolPresent ¶
func ConsulStringToStructFunc ¶
func ConsulStringToStructFunc() mapstructure.DecodeHookFunc
func FileModeGoString ¶
func FileModePresent ¶
func IntGoString ¶
func IntPresent ¶
func SignalGoString ¶
func SignalPresent ¶
func StringGoString ¶
func StringPresent ¶
func StringToFileModeFunc ¶
func StringToFileModeFunc() mapstructure.DecodeHookFunc
func TimeDurationGoString ¶
func TimeDurationPresent ¶
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Enabled *bool `mapstructure:"enabled"`
Username *string `mapstructure:"username"`
Password *string `mapstructure:"password"`
}
func DefaultAuthConfig ¶
func DefaultAuthConfig() *AuthConfig
func ParseAuthConfig ¶
func ParseAuthConfig(s string) (*AuthConfig, error)
func (*AuthConfig) Copy ¶
func (c *AuthConfig) Copy() *AuthConfig
func (*AuthConfig) Finalize ¶
func (c *AuthConfig) Finalize()
func (*AuthConfig) GoString ¶
func (c *AuthConfig) GoString() string
func (*AuthConfig) Merge ¶
func (c *AuthConfig) Merge(o *AuthConfig) *AuthConfig
func (*AuthConfig) String ¶
func (c *AuthConfig) String() string
type Config ¶
type Config struct {
Consul *ConsulConfig `mapstructure:"consul"`
KillSignal *os.Signal `mapstructure:"kill_signal"`
LogLevel *string `mapstructure:"log_level"`
PidFile *string `mapstructure:"pid_file"`
ReloadSignal *os.Signal `mapstructure:"reload_signal"`
Syslog *SyslogConfig `mapstructure:"syslog"`
From *string `mapstructure:"from"`
To *string `mapstructure:"to"`
Interval *time.Duration `mapstructure:"interval"`
}
func DefaultConfig ¶
func DefaultConfig() *Config
func TestConfig ¶
type ConsulConfig ¶
type ConsulConfig struct {
Address *string
Auth *AuthConfig `mapstructure:"auth"`
Retry *RetryConfig `mapstructure:"retry"`
SSL *SSLConfig `mapstructure:"ssl"`
Token *string
Transport *TransportConfig `mapstructure:"transport"`
}
func DefaultConsulConfig ¶
func DefaultConsulConfig() *ConsulConfig
func (*ConsulConfig) Copy ¶
func (c *ConsulConfig) Copy() *ConsulConfig
func (*ConsulConfig) Finalize ¶
func (c *ConsulConfig) Finalize()
func (*ConsulConfig) GoString ¶
func (c *ConsulConfig) GoString() string
func (*ConsulConfig) Merge ¶
func (c *ConsulConfig) Merge(o *ConsulConfig) *ConsulConfig
type EnvConfig ¶
type EnvConfig struct {
Blacklist []string `mapstructure:"blacklist"`
Custom []string `mapstructure:"custom"`
Pristine *bool `mapstructure:"pristine"`
Whitelist []string `mapstructure:"whitelist"`
}
func DefaultEnvConfig ¶
func DefaultEnvConfig() *EnvConfig
type RetryConfig ¶
type RetryConfig struct {
Attempts *int
Backoff *time.Duration
MaxBackoff *time.Duration `mapstructure:"max_backoff"`
Enabled *bool
}
func DefaultRetryConfig ¶
func DefaultRetryConfig() *RetryConfig
func (*RetryConfig) Copy ¶
func (c *RetryConfig) Copy() *RetryConfig
func (*RetryConfig) Finalize ¶
func (c *RetryConfig) Finalize()
func (*RetryConfig) GoString ¶
func (c *RetryConfig) GoString() string
func (*RetryConfig) Merge ¶
func (c *RetryConfig) Merge(o *RetryConfig) *RetryConfig
func (*RetryConfig) RetryFunc ¶
func (c *RetryConfig) RetryFunc() RetryFunc
type SSLConfig ¶
type SSLConfig struct {
CaCert *string `mapstructure:"ca_cert"`
CaPath *string `mapstructure:"ca_path"`
Cert *string `mapstructure:"cert"`
Enabled *bool `mapstructure:"enabled"`
Key *string `mapstructure:"key"`
ServerName *string `mapstructure:"server_name"`
Verify *bool `mapstructure:"verify"`
}
func DefaultSSLConfig ¶
func DefaultSSLConfig() *SSLConfig
type SyslogConfig ¶
type SyslogConfig struct {
Enabled *bool `mapstructure:"enabled"`
Facility *string `mapstructure:"facility"`
}
func DefaultSyslogConfig ¶
func DefaultSyslogConfig() *SyslogConfig
func (*SyslogConfig) Copy ¶
func (c *SyslogConfig) Copy() *SyslogConfig
func (*SyslogConfig) Finalize ¶
func (c *SyslogConfig) Finalize()
func (*SyslogConfig) GoString ¶
func (c *SyslogConfig) GoString() string
func (*SyslogConfig) Merge ¶
func (c *SyslogConfig) Merge(o *SyslogConfig) *SyslogConfig
type TransportConfig ¶
type TransportConfig struct {
DialKeepAlive *time.Duration `mapstructure:"dial_keep_alive"`
DialTimeout *time.Duration `mapstructure:"dial_timeout"`
DisableKeepAlives *bool `mapstructure:"disable_keep_alives"`
IdleConnTimeout *time.Duration `mapstructure:"idle_conn_timeout"`
MaxIdleConns *int `mapstructure:"max_idle_conns"`
MaxIdleConnsPerHost *int `mapstructure:"max_idle_conns_per_host"`
TLSHandshakeTimeout *time.Duration `mapstructure:"tls_handshake_timeout"`
}
func DefaultTransportConfig ¶
func DefaultTransportConfig() *TransportConfig
func (*TransportConfig) Copy ¶
func (c *TransportConfig) Copy() *TransportConfig
func (*TransportConfig) Finalize ¶
func (c *TransportConfig) Finalize()
func (*TransportConfig) GoString ¶
func (c *TransportConfig) GoString() string
func (*TransportConfig) Merge ¶
func (c *TransportConfig) Merge(o *TransportConfig) *TransportConfig
Click to show internal directories.
Click to hide internal directories.