config

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path

func Path() string

Path returns the absolute path to the config file. Resolution order:

  1. $CLAUMETER_CONFIG (escape hatch, useful in tests)
  2. $XDG_CONFIG_HOME/claumeter/config.toml
  3. $HOME/.config/claumeter/config.toml
  4. ./claumeter.toml (fallback if $HOME is unset)

func Save

func Save(c *Config) error

Save writes c to Path() atomically (tmp file + rename). The parent directory is created with mode 0o700 if it does not exist.

Types

type Config

type Config struct {
	Theme          string         `toml:"theme"`                    // "dark" | "light" | "high-contrast"
	DefaultRange   string         `toml:"default_range"`            // "today" | "yesterday" | "last-7d" | "last-30d" | "this-week" | "this-month" | "all"
	DaemonHost     string         `toml:"daemon_host"`              // default "127.0.0.1"
	DaemonPort     int            `toml:"daemon_port"`              // default 7777
	Plan           string         `toml:"plan,omitempty"`           // reserved: "pro" | "max-5x" | "max-20x" | ""
	OnboardingSeen bool           `toml:"onboarding_seen"`          // true after first-run welcome overlay is dismissed
	TabViewCount   map[string]int `toml:"tab_view_count,omitempty"` // counts tab visits for "new!" hints
}

Config holds all user-configurable settings for claumeter. Fields are intentionally flat — no nested sections yet.

func Defaults

func Defaults() *Config

Defaults returns a *Config populated with sensible defaults.

func Load

func Load() (*Config, error)

Load reads the config file at Path(). If the file does not exist, Defaults() is returned with no error. If the file exists but is malformed, an error is returned.

Jump to

Keyboard shortcuts

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