config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintConfig

func PrintConfig(cfg *Config)

Types

type Config

type Config struct {
	Monitor MonitorConfig `mapstructure:"Monitor"`
	DB      DBConfig      `mapstructure:"Database"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

type DBConfig

type DBConfig struct {
	Type      string          `mapstructure:"Type"`
	BatchSize int             `mapstructure:"BatchSize"`
	FlushTime string          `mapstructure:"FlushInterval"`
	InfluxDB  *InfluxDBConfig `mapstructure:"Influxdb"`
}

type Enabled

type Enabled struct {
	Task   bool `mapstructure:"Task"`
	IPMI   bool `mapstructure:"Ipmi"`
	GPU    bool `mapstructure:"Gpu"`
	RAPL   bool `mapstructure:"Rapl"`
	System bool `mapstructure:"System"`
}

type InfluxDBConfig

type InfluxDBConfig struct {
	URL        string `mapstructure:"Url"`
	Token      string `mapstructure:"Token"`
	Org        string `mapstructure:"Org"`
	NodeBucket string `mapstructure:"NodeBucket"`
	TaskBucket string `mapstructure:"TaskBucket"`
}

type MonitorConfig

type MonitorConfig struct {
	SamplePeriod string  `mapstructure:"SamplePeriod"`
	Enabled      Enabled `mapstructure:"Enabled"`
	LogPath      string  `mapstructure:"LogPath"`
	GPUType      string  `mapstructure:"GPUType"`
}

Jump to

Keyboard shortcuts

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