config

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package config provides configuration management functions

Index

Constants

View Source
const JSONFlagName = "json"
View Source
const PBFlagName = "pb"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Listen      string            `yaml:"listen"`
	StdinFormat string            `yaml:"stdinFormat"`
	Loki        LokiConfig        `yaml:"loki"`
	IPFields    map[string]string `yaml:"ipFields"`
	PrintInput  bool              `yaml:"printInput"`
	PrintOutput bool              `yaml:"printOutput"`
}

func Default

func Default() *Config

func Load

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

Load loads the YAML configuration from the file path passed as argument

func Read

func Read(in io.Reader) (*Config, error)

Read reads a YAML configuration from the io.Reader passed as argument

type LokiConfig

type LokiConfig struct {
	URL            string                    `yaml:"url"`
	TenantID       string                    `yaml:"tenantID"`
	BatchWait      time.Duration             `yaml:"batchWait"`
	BatchSize      int                       `yaml:"batchSize"`
	Timeout        time.Duration             `yaml:"timeout"`
	MinBackoff     time.Duration             `yaml:"minBackoff"`
	MaxBackoff     time.Duration             `yaml:"maxBackoff"`
	MaxRetries     int                       `yaml:"maxRetries"`
	Labels         []string                  `yaml:"labels"`
	StaticLabels   model.LabelSet            `yaml:"staticLabels"`
	IgnoreList     []string                  `yaml:"ignoreList"`
	ClientConfig   promconf.HTTPClientConfig `yaml:"clientConfig"`
	TimestampLabel model.LabelName           `yaml:"timestampLabel"`
	// TimestampScale provides the scale in time of the units from the timestamp
	// E.g. UNIX time scale is '1s' (one second) while other clock sources might have
	// scales of '1ms' (one millisecond) or just '1' (one nanosecond)
	// Default value is '1s'
	TimestampScale time.Duration `yaml:"timestampScale"`
}

func (*LokiConfig) Validate

func (c *LokiConfig) Validate() error

Jump to

Keyboard shortcuts

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