config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 4 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 abs-cli configuration directory path.

Types

type Config

type Config struct {
	Server   ServerConfig   `toml:"server"`
	Player   PlayerConfig   `toml:"player"`
	Theme    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"`
	NextInQueue  string `toml:"next_in_queue"`
	SpeedUp      string `toml:"speed_up"`
	SpeedDown    string `toml:"speed_down"`
	VolumeUp     string `toml:"volume_up"`
	VolumeDown   string `toml:"volume_down"`
	NextChapter  string `toml:"next_chapter"`
	PrevChapter  string `toml:"prev_chapter"`
	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"`
}

type ThemeConfig

type ThemeConfig struct {
	Background string `toml:"background"`
	Foreground string `toml:"foreground"`
	Accent     string `toml:"accent"`
	Error      string `toml:"error"`
	Muted      string `toml:"muted"`
	Selected   string `toml:"selected"`
	Border     string `toml:"border"`
	Warning    string `toml:"warning"`
	Info       string `toml:"info"`
}

Jump to

Keyboard shortcuts

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