Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandSecret ¶
RandSecret If the daemon does not have a secret key configured, it is automatically generated
Types ¶
type Config ¶
type Config struct {
Port string `json:"port"`
Secret string `json:"secret"`
ReadTimeout time.Duration `json:"readTimeout"`
WriteTimeout time.Duration `json:"writeTimeout"`
IdleTimeout time.Duration `json:"idleTimeout"`
Log *LogConfig `json:"log"`
DB *DBConfig `json:"db"`
Trace *metrics.TraceConfig `json:"traceConfig"`
}
func DecodeConfig ¶
func DefaultConfig ¶
type InfluxDBConfig ¶
type LogConfig ¶
type LogConfig struct {
LogLevel string `json:"logLevel"`
Type LogHookType `json:"type"`
HookSwitch bool `json:"hookSwitch"`
InfluxDB *InfluxDBConfig `json:"influxdb"`
}
type Provider ¶
type Provider interface {
GetString(key string) string
GetInt(key string) int
GetBool(key string) bool
GetStringMap(key string) map[string]interface{}
GetStringMapString(key string) map[string]string
GetStringSlice(key string) []string
Get(key string) interface{}
Set(key string, value interface{})
IsSet(key string) bool
WatchConfig()
OnConfigChange(run func(in fsnotify.Event))
Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
}
func FromConfigString ¶
FromConfigString creates a config from the given YAML, JSON or TOML config. This is useful in tests.
Click to show internal directories.
Click to hide internal directories.