config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

func ConfigPath

func ConfigPath() string

func Save

func Save(cfg Config) error

func SaveAutoDetected

func SaveAutoDetected(accounts []core.AccountConfig) error

SaveAutoDetected persists auto-detected accounts into the config file (read-modify-write).

func SaveAutoDetectedTo

func SaveAutoDetectedTo(path string, accounts []core.AccountConfig) error

func SaveDashboardProviders

func SaveDashboardProviders(providers []DashboardProviderConfig) error

SaveDashboardProviders persists dashboard provider preferences into the config file (read-modify-write).

func SaveDashboardProvidersTo

func SaveDashboardProvidersTo(path string, providers []DashboardProviderConfig) error

func SaveTheme

func SaveTheme(theme string) error

SaveTheme persists a theme name into the config file (read-modify-write).

func SaveThemeTo

func SaveThemeTo(path string, theme string) error

func SaveTo

func SaveTo(path string, cfg Config) error

Types

type Config

type Config struct {
	UI                   UIConfig             `json:"ui"`
	Theme                string               `json:"theme"`
	Experimental         ExperimentalConfig   `json:"experimental"`
	Dashboard            DashboardConfig      `json:"dashboard"`
	AutoDetect           bool                 `json:"auto_detect"`
	Accounts             []core.AccountConfig `json:"accounts"`
	AutoDetectedAccounts []core.AccountConfig `json:"auto_detected_accounts"`
}

func DefaultConfig

func DefaultConfig() Config

func Load

func Load() (Config, error)

func LoadFrom

func LoadFrom(path string) (Config, error)

type DashboardConfig

type DashboardConfig struct {
	Providers []DashboardProviderConfig `json:"providers"`
}

type DashboardProviderConfig

type DashboardProviderConfig struct {
	AccountID string `json:"account_id"`
	Enabled   bool   `json:"enabled"`
}

func (*DashboardProviderConfig) UnmarshalJSON

func (p *DashboardProviderConfig) UnmarshalJSON(data []byte) error

type ExperimentalConfig

type ExperimentalConfig struct {
	Analytics bool `json:"analytics"`
}

type UIConfig

type UIConfig struct {
	RefreshIntervalSeconds int     `json:"refresh_interval_seconds"`
	WarnThreshold          float64 `json:"warn_threshold"`
	CritThreshold          float64 `json:"crit_threshold"`
}

Jump to

Keyboard shortcuts

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