config

package
v0.0.0-...-d65772c Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(hostList HostList, host Host) bool

Types

type Config

type Config struct {
	Hosts        map[interface{}]interface{} `yaml:"hosts"`
	Metrics      map[interface{}]interface{} `yaml:"metrics"`
	Title        string                      `yaml:"title"`
	PollInterval int                         `yaml:"poll-interval"`
}

func LoadConfig

func LoadConfig(configPath string) *Config

type Connection

type Connection struct {
	Type                 string `mapstructure:"type"`
	Username             string `mapstructure:"username"`
	Password             string `mapstructure:"password"`
	PrivateKeyPath       string `mapstructure:"private_key_path"`
	PrivateKeyPassPhrase string `mapstructure:"private_key_passphrase"`
	Port                 int32  `mapstructure:"port"`
	Host                 string
}

type DashboardInfo

type DashboardInfo struct {
	Hosts        []Host
	Metrics      Metrics
	Title        string
	PollInterval int
}

func GetDashboardInfoConfig

func GetDashboardInfoConfig(config *Config) *DashboardInfo

func (*DashboardInfo) GetAllHostAddresses

func (dashboardInfo *DashboardInfo) GetAllHostAddresses() (addresses HostList)

GetAllHostAddresses : returns list of all hosts in the dashboard

type Host

type Host struct {
	Address    string
	Alias      string
	Connection *Connection
	// Metrics : extend global metrics with single metrics
	Metrics Metrics
}

type HostList

type HostList = []string

type Metrics

type Metrics = map[string]string

func MergeMetrics

func MergeMetrics(a, b Metrics) (metrics Metrics)

Jump to

Keyboard shortcuts

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