config

package
v0.0.0-...-4c031ee Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCollector

func RegisterCollector(reg prometheus.Registerer)

Types

type Config

type Config struct {
	Collects collector.Collects `yaml:"collects"`
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

func (*Config) Init

func (c *Config) Init(logger log.Logger) error

func (*Config) LoadConfig

func (c *Config) LoadConfig(configPath string) error

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(value *yaml.Node) error

type SafeConfig

type SafeConfig struct {
	sync.RWMutex
	C *Config
}

func NewSafeConfig

func NewSafeConfig() *SafeConfig

func (*SafeConfig) GetConfig

func (sc *SafeConfig) GetConfig() *Config

func (*SafeConfig) ReloadConfig

func (sc *SafeConfig) ReloadConfig(confPath string, logger log.Logger) (err error)

func (*SafeConfig) ReloadConfigFromReader

func (sc *SafeConfig) ReloadConfigFromReader(reader io.ReadCloser, logger log.Logger) (err error)

func (*SafeConfig) SetConfig

func (sc *SafeConfig) SetConfig(conf *Config)

Jump to

Keyboard shortcuts

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