config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultShutDownTimeout = "10s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLogConfig

type AccessLogConfig struct {
	Format *string  `yaml:"format" validate:"required"`
	Path   *string  `yaml:"path"`
	Fields []string `yaml:"fields" validate:"required"`
}

type Config

type Config struct {
	Listen          *string                   `yaml:"listen" validate:"required"`
	TLSConfig       *TLSConfig                `yaml:"tls"`
	ShutDownTimeout *time.Duration            `yaml:"shutdown_timeout"`
	ExporterConfigs map[string]ExporterConfig `yaml:"exporters" validate:"required,dive"`
	AccessLogConfig *AccessLogConfig          `yaml:"access_log"`
	ErrorLogConfig  *ErrorLogConfig           `yaml:"error_log"`
}

func LoadConfigFromYAML

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

func (*Config) Validate

func (c *Config) Validate() error

type ErrorLogConfig

type ErrorLogConfig struct {
	Path *string `yaml:"path" validate"required"`
}

type ExporterConfig

type ExporterConfig struct {
	URL                *string `yaml:"url" validate:"required"`
	Path               *string `yaml:"path" validate:"required"`
	InsecureSkipVerify *bool   `yaml:"insecure_skip_verify"`
}

type TLSConfig added in v0.3.0

type TLSConfig struct {
	CertFile *string `yaml:"certfile" validate:"required"`
	KeyFile  *string `yaml:"keyfile" validate:"required"`
}

Jump to

Keyboard shortcuts

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