config

package
v0.0.0-...-fc6be62 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "0.1.1"

Variables

View Source
var (
	Config *ConfYaml

	Endpoint string
	Cwd      string
)

Functions

func InitLog

func InitLog(l LoggerSection)

func Parse

func Parse(conf string) error

Types

type ConfYaml

type ConfYaml struct {
	Logger      LoggerSection    `yaml:"logger"`
	Interval    int64            `yaml:"interval"`
	Report      ReportSection    `yaml:"report"`
	Vspheres    []VsphereSection `yaml:"vspheres"`
	Performance PerfSection      `yaml:"performance"`
}

func Get

func Get() *ConfYaml

Get configuration file

type LoggerSection

type LoggerSection struct {
	Dir       string `json:"dir"`
	Level     string `json:"level"`
	KeepHours uint   `json:"keepHours"`
}

type PerfSection

type PerfSection struct {
	Esxi []string `yaml:"esxi"`
	VM   []string `yaml:"vm"`
}

type ReportSection

type ReportSection struct {
	Token   string `yaml:"token"`
	Cate    string `yaml:"cate"`
	UniqKey string `yaml:"uniqkey"`
	Tenant  string `yaml:"tenant"`
}

type VsphereSection

type VsphereSection struct {
	Addr       string   `yaml:"addr"`
	User       string   `yaml:"user"`
	Pwd        string   `yaml:"pwd"`
	EsxiPerf   bool     `yaml:"esxiperf"`
	VM         bool     `yaml:"vm"`
	Nid        string   `yaml:"nid"`
	VmList     []string `yaml:"vmlist"`
	VmPerf     bool     `yaml:"vmperf"`
	VmPerfList []string `yaml:"vmperflist"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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