config

package
v0.0.0-...-e01e93b Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: GPL-3.0 Imports: 6 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 {
	APICertFile string `yaml:"api_certfile"`
	APIPassword string `yaml:"api_password"`
	APIUser     string `yaml:"api_user"`

	BaseURLSatAPI  string `yaml:"baseurl_satellite"`
	BaseURLPromAPI string `yaml:"baseurl_prometheus"`

	ExporterJob string `yaml:"exporter_job"`
	OutJSON     string `yaml:"target_filename"`
	OutJSONTmp  string `yaml:"target_filename_tmp"`
	// Labels is a map of all labels that should be applied to auto-registered hosts.
	Labels map[string]string `yaml:"target_labels"`
	// AutoLabel is used to identify targets that have been auto-added.  The Labels map MUST include a key
	// matching AutoLabel.
	AutoLabel string `yaml:"autohosts_label"`
	AutoPort  int    `yaml:"autohosts_port"`
	// These hosts will not be added to the autohosts target file
	ExcludeHosts  []string `yaml:"exclude_hosts"`
	ExcludePrefix []string `yaml:"exclude_host_prefix"`
}

Config contains all the configuration settings for promsat

func ParseConfig

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

ParseConfig expects a YAML formatted config file and populates a Config struct

func (*Config) WriteConfig

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

WriteConfig will create a YAML formatted config file from a Config struct

type Flags

type Flags struct {
	Config  string
	Debug   bool
	Version bool
}

Flags are the command line flags

func ParseFlags

func ParseFlags() *Flags

ParseFlags transcribes command line flags into a struct

Jump to

Keyboard shortcuts

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