config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GlobalConfig       GlobalConfig         `yaml:"global"`
	MeasurementsConfig []*MeasurementConfig `yaml:"measurements,omitempty"`
}

func Load

func Load(s string) (*Config, error)

Load parses the YAML input s into a Config.

func LoadFile

func LoadFile(filename string) (*Config, error)

LoadFile parses the given YAML file into a Config.

func (Config) String

func (c Config) String() string

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type GlobalConfig

type GlobalConfig struct {
	MeasurementsWhitelist []string `yaml:"measurements_whitelist,omitempty"`
	TagsWhitelist         []string `yaml:"tags_whitelist,omitempty"`
}

GlobalConfig configures values that are used across other configuration objects.

func (*GlobalConfig) UnmarshalYAML

func (c *GlobalConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type MeasurementConfig

type MeasurementConfig struct {
	Name       string   `yaml:"name"`
	Tags       []string `yaml:"tags,omitempty"`
	Database   string   `yaml:"database,omitempty"`
	Fields     []string `yaml:"fields,omitempty"`
	DropLabels []string `yaml:"drop_labels,omitempty"`
}

func (*MeasurementConfig) UnmarshalYAML

func (c *MeasurementConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

Jump to

Keyboard shortcuts

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