config

package
v0.0.0-...-29da2f4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvVarPrefix = "CLOUDSURVEY_"
)

Variables

This section is empty.

Functions

func ApplyEnvironmentVariables

func ApplyEnvironmentVariables(tree *toml.Tree) error

ApplyEnvironmentVariables will overwrite any values in the tree for which an environmental override of the form CLOUDSURVEY_... is found. Overrides follow the same conventions as InfluxDB.

Types

type Config

type Config struct {
	Main        Main                     `toml:"main"`
	Credentials map[string][]*Credential `toml:"credentials"`
	Sources     map[string][]*Source     `toml:"sources"`
}

func FromBytes

func FromBytes(bytes []byte) (*Config, error)

func FromFile

func FromFile(path string) (*Config, error)

func FromReader

func FromReader(r io.Reader) (*Config, error)

func FromString

func FromString(content string) (*Config, error)

func FromTree

func FromTree(tree *toml.Tree) (*Config, error)

type Credential

type Credential struct {
	Name       string            `toml:"name"`
	From       string            `toml:"from"`
	Scopes     []string          `toml:"scopes"`
	MetricTags map[string]string `toml:"metric_tags"`
	Disabled   bool              `toml:"disabled"`
	// contains filtered or unexported fields
}

func (*Credential) Configure

func (c *Credential) Configure(x interface{}) error

type Main

type Main struct {
	Verbose bool `toml:"verbose"`
}

type Source

type Source struct {
	Name       string            `toml:"name"`
	Scopes     []string          `toml:"scopes"`
	MetricTags map[string]string `toml:"metric_tags"`
	Disabled   bool              `toml:"disabled"`
	// contains filtered or unexported fields
}

func (*Source) Configure

func (s *Source) Configure(x interface{}) error

Jump to

Keyboard shortcuts

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