config

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfFilePath

func ConfFilePath() (string, error)

ConfFilePath returns the full path to the config file (~/.loadbarsrc).

func GetClusterHosts

func GetClusterHosts(cluster string) ([]string, error)

GetClusterHosts resolves a cluster name from /etc/clusters into a list of hosts.

func GetClusterHostsFromFile

func GetClusterHostsFromFile(cluster, path string) ([]string, error)

GetClusterHostsFromFile resolves a cluster from a clusters file (for testing or custom path). Supports recursive cluster references with cycle detection.

Types

type Config

type Config struct {
	Hosts          []string // Each entry is "host" or "host:user"
	Title          string
	BarWidth       int
	CPUAverage     int
	Extended       bool
	HasAgent       bool
	Height         int
	MaxWidth       int
	NetAverage     int
	NetLink        string
	ShowAvgLine    bool
	ShowIOAvgLine  bool
	ShowCores      bool
	ShowMem        bool
	ShowNet        bool
	ShowSeparators bool
	MaxBarsPerRow  int
	SSHOpts        string
	Cluster        string
}

Config holds all loadbars configuration (file + CLI). Defaults match the Perl Shared.pm %C.

func Default

func Default() Config

Default returns a Config with default values.

func (*Config) Load

func (c *Config) Load() error

Load reads config from the config file and merges into c. Unknown keys are ignored.

func (*Config) Write

func (c *Config) Write() error

Write saves the current config to the config file (excluding title).

Jump to

Keyboard shortcuts

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