config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	NJmon struct {
		Address string `yaml:"address"`
		Port    string `yaml:"port"`
	} `yaml:"njmon"`
	Logging struct {
		Journal  bool   `yaml:"journal"`
		LevelStr string `yaml:"level"`
	} `yaml:"logging"`
	Exporter struct {
		Address string `yaml:"address"`
		Port    string `yaml:"port"`
	} `yaml:"exporter"`
	InstanceLabel struct {
		Name      string   `yaml:"label_name"`
		Hit       string   `yaml:"label_hit"`
		Miss      string   `yaml:"label_miss"`
		Instances []string `yaml:"hit_instances"`
	} `yaml:"instance_label"`
	Thresholds struct {
		// AliveTimeout is the period of time (in seconds) a host is considered alive without checking in.
		AliveTimeout int `yaml:"alive_timeout"`
		// ConnectionTimeout is the maximum time (in seconds) to wait for data.
		ConnectionTimout int `yaml:"connection_timeout"`
	} `yaml:"thresholds"`
}

Config contains the njmon_exporter configuration data

func ParseConfig

func ParseConfig(filename string) (*Config, error)

ParseConfig imports a yaml formatted config file into a Config struct

type Flags

type Flags struct {
	Config string
	Debug  bool
}

Flags are the command line Flags

func ParseFlags

func ParseFlags() *Flags

parseFlags processes arguments passed on the command line in the format standard format: --foo=bar

Jump to

Keyboard shortcuts

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