config

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

ConfigDir returns the spruce configuration directory path.

func Save

func Save(path string, cfg Config) error

Save writes a Config struct to path in TOML format atomically with 0600 permissions.

Types

type Config

type Config struct {
	Server   ServerConfig   `toml:"server"`
	Player   PlayerConfig   `toml:"player"`
	Theme    ui.ThemeConfig `toml:"theme"`
	Keybinds KeybindsConfig `toml:"keybinds"`
}

func Default

func Default() Config

func Load

func Load(path string) (Config, error)

Load reads a TOML config file at path, merging with defaults. If path is empty or the file doesn't exist, defaults are returned.

type KeybindsConfig

type KeybindsConfig struct {
	Quit         string `toml:"quit"`
	PlayPause    string `toml:"play_pause"`
	SeekForward  string `toml:"seek_forward"`
	SeekBackward string `toml:"seek_backward"`
	SpeedUp      string `toml:"speed_up"`
	SpeedDown    string `toml:"speed_down"`
	VolumeUp     string `toml:"volume_up"`
	VolumeDown   string `toml:"volume_down"`
	NextTrack    string `toml:"next_track"`
	PrevTrack    string `toml:"prev_track"`
	SleepTimer   string `toml:"sleep_timer"`
	Back         string `toml:"back"`
}

type PlayerConfig

type PlayerConfig struct {
	Speed       float64 `toml:"speed"`
	SeekSeconds int     `toml:"seek_seconds"`
}

type ServerConfig

type ServerConfig struct {
	Address    string `toml:"address"`
	Username   string `toml:"username"`
	Token      string `toml:"token"`
	UserID     string `toml:"user_id"`
	DeviceName string `toml:"device_name"`
	DeviceID   string `toml:"device_id"`
}

Jump to

Keyboard shortcuts

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