config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBorderStyles

func GetBorderStyles() []string

GetBorderStyles returns available border styles

func GetBorderTypes

func GetBorderTypes() []string

GetBorderTypes returns available border types

func GetConfigPath

func GetConfigPath() (string, error)

func GetRefreshRates

func GetRefreshRates() []int

GetRefreshRates returns available refresh rates in ms

func GetThemeNames

func GetThemeNames() []string

GetThemeNames returns available theme names

func ResolvePath added in v0.1.3

func ResolvePath(path string, defaultName string) (string, error)

func SaveConfig

func SaveConfig(config AppConfig) error

func WatchConfig

func WatchConfig(lastModTime time.Time) tea.Cmd

Types

type AppConfig

type AppConfig struct {
	Thresholds           map[MetricType]float64 `json:"thresholds"`
	CustomTheme          *CustomThemeConfig     `json:"custom_theme,omitempty"`
	RemoteHosts          []RemoteHostConfig     `json:"remote_hosts"`
	Tabs                 []string               `json:"tabs,omitempty"`
	ChartType            string                 `json:"chart_type"`
	ViewType             string                 `json:"view_type"`      // "normal" or "tree"
	SortBy               string                 `json:"sort_by"`        // "cpu", "mem", "pid", "name"`
	Theme                string                 `json:"theme"`          // dark, light, nord, dracula, custom, etc
	BorderType           string                 `json:"border_type"`    // normal, rounded
	BorderStyle          string                 `json:"border_style"`   // single, double, dashed
	SortDirection        string                 `json:"sort_direction"` // "asc" or "desc"
	DefaultTab           string                 `json:"default_tab,omitempty"`
	Logging              LoggingConfig          `json:"logging"`
	HealthWeights        HealthWeights          `json:"health_weights"`
	HistoryLength        int                    `json:"history_length"`
	RefreshRate          int                    `json:"refresh_rate"`      // milliseconds: 500, 1000, 2000, 5000
	BackgroundOpaque     bool                   `json:"background_opaque"` // true = opaque, false = transparent
	ProcessCpuNormalized bool                   `json:"process_cpu_normalized"`
}

func DefaultConfig

func DefaultConfig() AppConfig

func LoadConfig

func LoadConfig() (AppConfig, error)

func LoadConfigFromPath added in v0.6.0

func LoadConfigFromPath(path string) (AppConfig, error)

type ConfigChangeMsg

type ConfigChangeMsg struct {
	NewModTime time.Time
}

type ConfigWatchTickMsg

type ConfigWatchTickMsg struct{}

type CustomThemeConfig

type CustomThemeConfig struct {
	Primary    string `json:"primary"`
	Secondary  string `json:"secondary"`
	Success    string `json:"success"`
	Warning    string `json:"warning"`
	Alert      string `json:"alert"`
	Text       string `json:"text"`
	Muted      string `json:"muted"`
	Border     string `json:"border"`
	Background string `json:"background"`
}

func DefaultCustomTheme

func DefaultCustomTheme() *CustomThemeConfig

DefaultCustomTheme returns a default custom theme template

type HealthWeights added in v0.1.4

type HealthWeights struct {
	CpuCritical  int `json:"cpu_critical"`
	CpuHigh      int `json:"cpu_high"`
	MemCritical  int `json:"mem_critical"`
	MemHigh      int `json:"mem_high"`
	DiskCritical int `json:"disk_critical"`
	TempCritical int `json:"temp_critical"`
	TempHigh     int `json:"temp_high"`
}

type LoggingConfig

type LoggingConfig struct {
	Path    string `json:"path"`
	Enabled bool   `json:"enabled"`
}

type MetricType

type MetricType string

MetricType defines the type of system metric

const (
	MetricCPU  MetricType = "CPU"
	MetricMem  MetricType = "Memory"
	MetricDisk MetricType = "Disk"
	MetricTemp MetricType = "Temperature"
)

type RemoteHostConfig

type RemoteHostConfig struct {
	Name    string `json:"name"`
	Host    string `json:"host"`               // user@hostname or hostname
	KeyPath string `json:"key_path,omitempty"` // path to SSH private key
	Port    int    `json:"port,omitempty"`     // SSH port (default 22)
	Timeout int    `json:"timeout,omitempty"`  // connection timeout in seconds
}

Jump to

Keyboard shortcuts

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