Documentation ¶
Overview ¶
Package config handles config struct parsing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CfgType ¶ added in v0.6.0
CfgType represents an interface which any config field type must implement.
type ChangeNotification ¶ added in v0.11.0
ChangeNotification definition for a configuration change.
func (ChangeNotification) String ¶ added in v0.11.0
func (n ChangeNotification) String() string
type Config ¶
type Config struct {
Fields []*Field
}
Config manages configuration and handles updates on the values.
func New ¶
func New(cfg interface{}, chNotify chan<- ChangeNotification) (*Config, error)
New creates a new monitor.
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field definition of a config value that can change.
type Source ¶
type Source string
Source definition.
const ( // SourceSeed defines a seed value. SourceSeed Source = "seed" // SourceEnv defines a value from environment variables. SourceEnv Source = "env" // SourceConsul defines a value from consul. SourceConsul Source = "consul" // SourceRedis defines a value from redis. SourceRedis Source = "redis" // SourceFlag defines a value from CLI flag. SourceFlag Source = "flag" // SourceFile defines a value from external file. SourceFile Source = "file" )
Click to show internal directories.
Click to hide internal directories.