cfgfile

package
v0.0.0-...-4097794 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(out interface{}, path string) error

Read reads the configuration from a yaml file into the given interface structure. In case path is not set this method reads from the default configuration file.

func SetConfigPath

func SetConfigPath(path string)

Preserve path to configuration file for reloading the same file during lifetime

func ValidateConfig

func ValidateConfig() bool

ValidateConfig returns whether or not this configuration is used for testing

Types

type SidecarBackend

type SidecarBackend struct {
	Name              string `config:"name"`
	Enabled           *bool  `config:"enabled"`
	BinaryPath        string `config:"binary_path"`
	ConfigurationPath string `config:"configuration_path"`
	RunPath           string `config:"run_path"`
}

type SidecarConfig

type SidecarConfig struct {
	ServerUrl       string   `config:"server_url"`
	TlsSkipVerify   bool     `config:"tls_skip_verify"`
	NodeId          string   `config:"node_id"`
	CollectorId     string   `config:"collector_id"`
	Tags            []string `config:"tags"`
	CachePath       string   `config:"cache_path"`
	LogPath         string   `config:"log_path"`
	LogRotationTime int      `config:"log_rotation_time"`
	LogMaxAge       int      `config:"log_max_age"`
	UpdateInterval  int      `config:"update_interval"`
	SendStatus      bool     `config:"send_status"`
	ListLogFiles    []string `config:"list_log_files"`
	Backends        []SidecarBackend
}

func (*SidecarConfig) GetBackendIndexByName

func (sc *SidecarConfig) GetBackendIndexByName(name string) (int, error)

Jump to

Keyboard shortcuts

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