config

package
v0.0.3-0...-db3c646 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteFile

func WriteFile(filename string, content []byte) error

Types

type Config

type Config struct {
	ServerConfig  *ServerConfig
	MetricsConfig *MetricsConfig
}

func NewConfig

func NewConfig(endpoint, certPath, keyPath, secMode, secPolicy, authMode, username, password, configPath string) (*Config, error)

func (*Config) LoadMetricsConfig

func (c *Config) LoadMetricsConfig(filename string) error

type Metric

type Metric struct {
	Name   string            `yaml:"name"`
	Help   string            `yaml:"help"`
	NodeID string            `yaml:"nodeid"`
	Labels map[string]string `yaml:"labels"`
	Type   string            `yaml:"type"`
}

type MetricsConfig

type MetricsConfig struct {
	Metrics []Metric `yaml:"metrics"`
}

func (*MetricsConfig) Serialize

func (cfg *MetricsConfig) Serialize() ([]byte, error)

func (*MetricsConfig) Unserialize

func (mm *MetricsConfig) Unserialize(content []byte) error

type ServerConfig

type ServerConfig struct {
	Endpoint  string
	CertPath  string
	KeyPath   string
	SecPolicy string
	SecMode   string
	AuthMode  string
	Username  string
	Password  string
}

Jump to

Keyboard shortcuts

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