conf

package
v0.0.0-...-eac16e3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: GPL-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultConf

func GetDefaultConf() string

func Init_template

func Init_template() template.Template

Types

type Configuration

type Configuration struct {
	Load    *LoadConfiguration    `json:"load"`
	Net     *NetConfiguration     `json:"net"`
	Mem     *MemConfiguration     `json:"mem"`
	IO      *IOConfiguration      `json:"io"`
	Sensors *SensorsConfiguration `json:"sensors"`
}

func LoadConfFromBytes

func LoadConfFromBytes(json_input []byte) *Configuration

type ConfigurationManager

type ConfigurationManager struct {
	User    *Configuration
	Default *Configuration
}

func LoadConf

func LoadConf() *ConfigurationManager

func (*ConfigurationManager) GetIODevices

func (c *ConfigurationManager) GetIODevices() map[string]IODeviceConfiguration

func (*ConfigurationManager) GetIOIntervals

func (c *ConfigurationManager) GetIOIntervals() []IntervalDisplay

func (*ConfigurationManager) GetIOReadLabel

func (c *ConfigurationManager) GetIOReadLabel() string

func (*ConfigurationManager) GetIOReadLabelBg

func (c *ConfigurationManager) GetIOReadLabelBg() string

func (*ConfigurationManager) GetIOReadLabelFg

func (c *ConfigurationManager) GetIOReadLabelFg() string

func (*ConfigurationManager) GetIOWriteLabel

func (c *ConfigurationManager) GetIOWriteLabel() string

func (*ConfigurationManager) GetIOWriteLabelBg

func (c *ConfigurationManager) GetIOWriteLabelBg() string

func (*ConfigurationManager) GetIOWriteLabelFg

func (c *ConfigurationManager) GetIOWriteLabelFg() string

func (*ConfigurationManager) GetLoadIntervals

func (c *ConfigurationManager) GetLoadIntervals() []IntervalDisplay

func (*ConfigurationManager) GetMemIntervals

func (c *ConfigurationManager) GetMemIntervals() []IntervalDisplay

func (*ConfigurationManager) GetMemSeparator

func (c *ConfigurationManager) GetMemSeparator() string

func (*ConfigurationManager) GetMemSeparatorBg

func (c *ConfigurationManager) GetMemSeparatorBg() string

func (*ConfigurationManager) GetMemSeparatorFg

func (c *ConfigurationManager) GetMemSeparatorFg() string

func (*ConfigurationManager) GetMemTotalBg

func (c *ConfigurationManager) GetMemTotalBg() string

func (*ConfigurationManager) GetMemTotalFg

func (c *ConfigurationManager) GetMemTotalFg() string

func (*ConfigurationManager) GetNetDownLabel

func (c *ConfigurationManager) GetNetDownLabel() string

func (*ConfigurationManager) GetNetDownLabelBg

func (c *ConfigurationManager) GetNetDownLabelBg() string

func (*ConfigurationManager) GetNetDownLabelFg

func (c *ConfigurationManager) GetNetDownLabelFg() string

func (*ConfigurationManager) GetNetInterfaces

func (c *ConfigurationManager) GetNetInterfaces() map[string]NetIFConfiguration

func (*ConfigurationManager) GetNetIntervals

func (c *ConfigurationManager) GetNetIntervals() []IntervalDisplay

func (*ConfigurationManager) GetNetUpLabel

func (c *ConfigurationManager) GetNetUpLabel() string

func (*ConfigurationManager) GetNetUpLabelBg

func (c *ConfigurationManager) GetNetUpLabelBg() string

func (*ConfigurationManager) GetNetUpLabelFg

func (c *ConfigurationManager) GetNetUpLabelFg() string

func (*ConfigurationManager) GetSensorsTemplate

func (c *ConfigurationManager) GetSensorsTemplate(format string) template.Template

format -- CLI option

type IOConfiguration

type IOConfiguration struct {
	Devices      *map[string]IODeviceConfiguration `json:"devices"`
	ReadLabel    *string                           `json:"read_label"`
	ReadLabelBg  *string                           `json:"read_label_bg"`
	ReadLabelFg  *string                           `json:"read_label_fg"`
	WriteLabel   *string                           `json:"write_label"`
	WriteLabelBg *string                           `json:"write_label_bg"`
	WriteLabelFg *string                           `json:"write_label_fg"`
	Intervals    *[]IntervalDisplay                `json:"intervals"`
}

type IODeviceConfiguration

type IODeviceConfiguration struct {
	Alias        string `json:"alias"`
	LabelColorFg string `json:"label_color_fg"`
	LabelColorBg string `json:"label_color_bg"`
}

type IntervalDisplay

type IntervalDisplay struct {
	From    *string `json:"from"`
	To      *string `json:"to"`
	BgColor string  `json:"bg_color"`
	FgColor string  `json:"fg_color"`
}

func (*IntervalDisplay) GetFrom

func (i *IntervalDisplay) GetFrom() (float64, bool)

func (*IntervalDisplay) GetTo

func (i *IntervalDisplay) GetTo() (float64, bool)

type LoadConfiguration

type LoadConfiguration struct {
	Intervals *[]IntervalDisplay `json:"intervals"`
}

type MemConfiguration

type MemConfiguration struct {
	Intervals   *[]IntervalDisplay `json:"intervals"`
	Separator   *string            `json:"separator"`
	SeparatorBg *string            `json:"separator_bg"`
	SeparatorFg *string            `json:"separator_fg"`
	TotalBg     *string            `json:"total_bg"`
	TotalFg     *string            `json:"total_fg"`
}

type NetConfiguration

type NetConfiguration struct {
	Interfaces  *map[string]NetIFConfiguration `json:"interfaces"`
	UpLabel     *string                        `json:"upload_label"`
	UpLabelBg   *string                        `json:"upload_label_bg"`
	UpLabelFg   *string                        `json:"upload_label_fg"`
	DownLabel   *string                        `json:"download_label"`
	DownLabelBg *string                        `json:"download_label_bg"`
	DownLabelFg *string                        `json:"download_label_fg"`
	Intervals   *[]IntervalDisplay             `json:"intervals"`
}

type NetIFConfiguration

type NetIFConfiguration struct {
	Alias          string `json:"alias"`
	LabelColorFg   string `json:"label_color_fg"`
	LabelColorBg   string `json:"label_color_bg"`
	AddressColorFg string `json:"address_color_fg"`
	AddressColorBg string `json:"address_color_bg"`
}

type SensorsConfiguration

type SensorsConfiguration struct {
	Template *string `json:"template"`
}

configuration in a config file

Jump to

Keyboard shortcuts

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