sources

package
v3.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

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

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

Directories

Path Synopsis
Package zookeeper contains the logic for using Zookeeper as a config source.
Package zookeeper contains the logic for using Zookeeper as a config source.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL