sensors

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const Gibibyte = 1024 * 1024 * 1024

Variables

View Source
var ErrNoCPU = errors.New("no cpu found")

Functions

func NewBattery

func NewBattery(cfg entity.Config) *entity.Entity

func NewBatteryState

func NewBatteryState(cfg entity.Config) *entity.Entity

func NewCPU

func NewCPU(cfg entity.Config) *entity.Entity

func NewCustom added in v1.4.0

func NewCustom(cfg CustomConfig) *entity.Entity

func NewDisk

func NewDisk(cfg DiskConfig) []*entity.Entity

func NewDiskFree

func NewDiskFree(cfg DiskConfig) []*entity.Entity

func NewDiskUsed

func NewDiskUsed(cfg DiskConfig) []*entity.Entity

func NewMemory

func NewMemory(cfg entity.Config) *entity.Entity

func NewMemoryFree

func NewMemoryFree(cfg entity.Config) *entity.Entity

func NewMemoryUsed

func NewMemoryUsed(cfg entity.Config) *entity.Entity

func NewSwap

func NewSwap(cfg entity.Config) *entity.Entity

func NewSwapFree

func NewSwapFree(cfg entity.Config) *entity.Entity

func NewSwapUsed

func NewSwapUsed(cfg entity.Config) *entity.Entity

func NewUptime

func NewUptime(cfg entity.Config) *entity.Entity

Types

type Config

type Config struct {
	CPU *entity.Config `yaml:"cpu,omitempty"`

	Custom *CustomConfig `yaml:"custom,omitempty"`

	Disk     *DiskConfig `yaml:"disk,omitempty"`
	DiskUsed *DiskConfig `yaml:"disk_used,omitempty"`
	DiskFree *DiskConfig `yaml:"disk_free,omitempty"`

	Memory     *entity.Config `yaml:"memory,omitempty"`
	MemoryUsed *entity.Config `yaml:"memory_used,omitempty"`
	MemoryFree *entity.Config `yaml:"memory_free,omitempty"`

	Swap     *entity.Config `yaml:"swap,omitempty"`
	SwapUsed *entity.Config `yaml:"swap_used,omitempty"`
	SwapFree *entity.Config `yaml:"swap_free,omitempty"`

	Uptime *entity.Config `yaml:"uptime,omitempty"`

	Battery      *entity.Config `yaml:"battery,omitempty"`
	BatteryState *entity.Config `yaml:"battery_state,omitempty"`
}

func (*Config) LoadEntities

func (c *Config) LoadEntities() []*entity.Entity

type CustomConfig added in v1.4.0

type CustomConfig struct {
	utils.CommandConfig `yaml:",inline"`
	entity.Config       `yaml:",inline"`
	JsonAttributes      []string `yaml:"json_attributes,omitempty"`
	JsonAttributesPath  string   `yaml:"json_attributes_path,omitempty"`
}

type DiskConfig

type DiskConfig struct {
	Mountpoints   *[]string `yaml:"mountpoints"`
	entity.Config `yaml:",inline"`
}

Jump to

Keyboard shortcuts

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