config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load() (*EnvConfig, []Config, error)

Load method loads the configuration by using both flag or environment variables.

Types

type Config

type Config struct {
	PIHoleProtocol string `config:"pihole_protocol"`
	PIHoleHostname string `config:"pihole_hostname"`
	PIHolePort     uint16 `config:"pihole_port"`
	PIHolePassword string `config:"pihole_password"`
	PIHoleApiToken string `config:"pihole_api_token"`
}

Config is the exporter CLI configuration.

func (Config) PIHoleLoginURL added in v0.1.0

func (c Config) PIHoleLoginURL() string

PIHoleLoginURL returns the login url

func (Config) PIHoleStatsURL added in v0.1.0

func (c Config) PIHoleStatsURL() string

PIHoleStatsURL returns the stats url

func (*Config) String added in v0.1.0

func (c *Config) String() string

func (Config) Validate added in v0.1.0

func (c Config) Validate() error

Validate check if the config is valid

type EnvConfig added in v0.1.0

type EnvConfig struct {
	PIHoleProtocol []string      `config:"pihole_protocol"`
	PIHoleHostname []string      `config:"pihole_hostname"`
	PIHolePort     []uint16      `config:"pihole_port"`
	PIHolePassword []string      `config:"pihole_password"`
	PIHoleApiToken []string      `config:"pihole_api_token"`
	Port           uint16        `config:"port"`
	Interval       time.Duration `config:"interval"`
}

func (EnvConfig) Split added in v0.1.0

func (c EnvConfig) Split() ([]Config, error)

Jump to

Keyboard shortcuts

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