config

package
v0.0.0-...-1854870 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVConfig

type CSVConfig struct {
	File string `yaml:"file"`
}

type CollectorConfig

type CollectorConfig struct {
	Host         string `yaml:"host"`
	Port         int    `yaml:"port"`
	TLS          bool   `yaml:"tls"`
	HostOverride string `yaml:"hostOverride"`
	CA           string `yaml:"ca"`
	Username     string `yaml:"username"`
	Token        string `yaml:"token"`
}

type Config

type Config struct {
	Env            EnvConfig
	Interfaces     []string        `yaml:"interfaces"`
	Tests          []string        `yaml:"tests"`
	ResultHandlers []string        `yaml:"resultHandlers"`
	Ookla          OoklaConfig     `yaml:"ookla"`
	CSV            CSVConfig       `yaml:"csv"`
	Collector      CollectorConfig `yaml:"collector"`
}

Config encapsulates all speed-demon agent configuration

func GetConfig

func GetConfig() (Config, error)

GetConfig gets all speed-demon agent configuration

type EnvConfig

type EnvConfig struct {
	TestFrequency int    `envconfig:"TEST_FREQUENCY" default:"30"`
	AgentLogLevel string `envconfig:"LOG_LEVEL" default:"info"`
	ConfigFile    string `envconfig:"CONFIG_FILE" default:"/etc/speed-demon/config.yml"`
}

EnvConfig encapsulates low level configuration details specified by environment variables. Note that most other configuration is loaded from a YAML file specified by EnvConfig's ConfigFile attribute.

func (EnvConfig) LogLevel

func (c EnvConfig) LogLevel() loggo.Level

LogLevel returns the agent's log level

type OoklaConfig

type OoklaConfig struct {
	ServerID int `yaml:"serverId"`
}

Jump to

Keyboard shortcuts

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