Documentation ¶
Overview ¶
Package sources contains all of the config source logic. This includes logic to get config content from various sources such as the filesystem or a KV store. It also contains the logic for filling in dynamic values in config.
Index ¶
- func ReadConfig(configPath string, fileSource types.ConfigSource, stop <-chan struct{}, ...) ([]byte, <-chan []byte, error)
- func ReadDynamicValues(configContent []byte, fileSource types.ConfigSource, stop <-chan struct{}, ...) ([]byte, <-chan []byte, error)
- type RawDynamicValueSpec
- type SourceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadConfig ¶
func ReadConfig(configPath string, fileSource types.ConfigSource, stop <-chan struct{}, shouldWatch bool) ([]byte, <-chan []byte, error)
ReadConfig reads in the main agent config file and optionally watches for changes on it. It will be returned immediately, along with a channel that will be sent any updated config content if watching is enabled.
func ReadDynamicValues ¶
func ReadDynamicValues(configContent []byte, fileSource types.ConfigSource, stop <-chan struct{}, shouldWatch bool) ([]byte, <-chan []byte, error)
ReadDynamicValues takes the config file content and processes it for any dynamic values of the form `{"#from": ...`. It returns a YAML document that contains the rendered values. It will optionally watch the sources of any dynamic values configured and send updated YAML docs on the returned channel.
Types ¶
type RawDynamicValueSpec ¶
type RawDynamicValueSpec interface{}
RawDynamicValueSpec is a string that should deserialize to a dynamic value path (e.g. {"#from": "/path/to/value"}).
type SourceConfig ¶
type SourceConfig struct { Zookeeper *zookeeper.Config `yaml:"zookeeper"` Etcd2 *etcd2.Config `yaml:"etcd2"` Consul *consul.Config `yaml:"consul"` }
SourceConfig represents configuration for various config sources that we support.
func (*SourceConfig) Sources ¶
func (sc *SourceConfig) Sources() (map[string]types.ConfigSource, error)
Sources returns a map of instantiated sources based on the config