config

package
v0.0.0-...-947f185 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: Apache-2.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 {
	API struct {
		Username string `yaml:"username"`
		Password string `yaml:"password"`
		CertFile string `yaml:"certfile"`
		Path     string `yaml:"path"`
	} `yaml:"api"`
	Logging struct {
		Filename string `yaml:"filename"`
		Journal  bool   `yaml:"journal"`
		LevelStr string `yaml:"level"`
	} `yaml:"logging"`
	Exporter struct {
		Hostname string `yaml:"hostname"`
		Port     int    `yaml:"port"`
	} `yaml:"exporter"`
}

func ParseConfig

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

ParseConfig imports a yaml formatted config file into 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
}

Flags are command line arguments

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