Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() (string, error)

DefaultPath returns the default config file path.

func WriteDefault

func WriteDefault(path string, force bool) error

WriteDefault writes a default config to path.

Types

type AudioConfig

type AudioConfig struct {
	SampleRate      int `toml:"sample_rate" comment:"Output sample rate in Hz. 44100 is a safe default."`
	ResampleQuality int `` /* 209-byte string literal not displayed */
	BufferMs        int `toml:"buffer_ms" comment:"Speaker buffer size in milliseconds (lower = lower latency, higher = more stable)."`
}

AudioConfig holds audio-related settings.

func (AudioConfig) Validate added in v0.9.8

func (c AudioConfig) Validate() error

Validate ensures audio settings are sane.

type ByteSize added in v0.9.6

type ByteSize int64

ByteSize stores a byte count and marshals to TOML as a unit-bearing string.

func (ByteSize) MarshalText added in v0.9.6

func (b ByteSize) MarshalText() ([]byte, error)

MarshalText serializes a byte size as an explicit unit-bearing string.

func (ByteSize) String added in v0.9.6

func (b ByteSize) String() string

func (*ByteSize) UnmarshalText added in v0.9.6

func (b *ByteSize) UnmarshalText(text []byte) error

UnmarshalText parses a byte size string with an explicit supported unit.

type CacheConfig

type CacheConfig struct {
	Dir string `toml:"dir" comment:"Base directory where cache files are stored"`
}

type Config

type Config struct {
	Audio   AudioConfig   `toml:"audio"`
	MPRIS   MPRISConfig   `toml:"mpris"`
	IPC     IPCConfig     `toml:"ipc"`
	TUI     TUIConfig     `toml:"tui"`
	Lyrics  LyricsConfig  `toml:"lyrics"`
	Cache   CacheConfig   `toml:"cache"`
	Library LibraryConfig `toml:"library"`
}

Config is the root configuration object.

func Default

func Default() Config

Default returns the default configuration.

func Load

func Load(path string) (Config, error)

Load reads a TOML config from path. Missing files return defaults.

func (Config) Validate

func (c Config) Validate() error

Validate ensures configuration values are sane.

type IPCConfig added in v0.9.7

type IPCConfig struct {
	SingleInstance SingleInstanceMode `toml:"single_instance" comment:"Single-instance handoff method: auto, unix-socket, or off."`
}

IPCConfig holds single-instance IPC settings.

func (IPCConfig) Validate added in v0.9.7

func (c IPCConfig) Validate() error

Validate ensures the configured IPC mode is recognized.

type LibraryConfig added in v0.9.6

type LibraryConfig struct {
	MaxArchiveMemberSize ByteSize `toml:"max_archive_member_size" comment:"Maximum decoded size of one file inside an archive."`
}

LibraryConfig holds media library settings.

func (LibraryConfig) Validate added in v0.9.8

func (c LibraryConfig) Validate() error

Validate ensures library settings are sane.

type LrcLibCacheConfig

type LrcLibCacheConfig struct {
	Enabled bool `toml:"enabled" comment:"Enable on-disk cache for lyrics"`
}

type LrcLibConfig

type LrcLibConfig struct {
	Enabled bool              `toml:"enabled" comment:"Enable lrclib.net integration for obtaining lyrics."`
	Cache   LrcLibCacheConfig `toml:"cache"`
}

type LyricsConfig

type LyricsConfig struct {
	LrcLib LrcLibConfig `toml:"lrclib"`
}

type MPRISConfig

type MPRISConfig struct {
	Enabled bool `toml:"enabled" comment:"Enable DBus/MPRIS integration for media controls."`
}

MPRISConfig holds DBus/MPRIS integration settings.

type SingleInstanceMode added in v0.9.7

type SingleInstanceMode string

SingleInstanceMode selects the IPC method used for single-instance handoff.

const (
	// SingleInstanceAuto uses the platform's preferred supported IPC method.
	SingleInstanceAuto SingleInstanceMode = "auto"
	// SingleInstanceUnixSocket explicitly requires Unix-socket IPC.
	SingleInstanceUnixSocket SingleInstanceMode = "unix-socket"
	// SingleInstanceOff disables single-instance IPC handoff.
	SingleInstanceOff SingleInstanceMode = "off"
)

type TUIConfig

type TUIConfig struct {
	FPS             int         `toml:"FPS" comment:"Frames per second for the terminal UI (1-120)."`
	ArtworkRenderer string      `toml:"artwork_renderer" comment:"Album artwork renderer: auto, kitty, blocks, or none."`
	ArtworkAspect   float64     `toml:"artwork_aspect" comment:"Artwork box width/height ratio for terminal cells (e.g., 2.0 looks square on most fonts)."`
	BrowserHome     string      `toml:"browser_home" comment:"Default directory of music browser"`
	Theme           ThemeConfig `toml:"theme"`
}

func (TUIConfig) Validate added in v0.9.8

func (c TUIConfig) Validate() error

Validate ensures TUI settings are sane.

type ThemeConfig added in v0.9.3

type ThemeConfig struct {
	Preset     string `toml:"preset" comment:"Built-in theme preset."`
	Primary    string `toml:"primary,omitempty" comment:"Override the main accent color (e.g., highlighting selected items)."`
	Secondary  string `toml:"secondary,omitempty" comment:"Override the secondary accent color (e.g., search highlights, minor elements)."`
	Muted      string `toml:"muted,omitempty" comment:"Override faded or dimmed text."`
	Highlight  string `toml:"highlight,omitempty" comment:"Override the highlight color."`
	Info       string `toml:"info,omitempty" comment:"Override info indications."`
	Danger     string `toml:"danger,omitempty" comment:"Override danger indications."`
	Warning    string `toml:"warning,omitempty" comment:"Override warning indications."`
	Working    string `toml:"working,omitempty" comment:"Override working indications."`
	Background string `toml:"background,omitempty" comment:"Override the background color; use 'terminal' for the terminal default."`
	Foreground string `toml:"foreground,omitempty" comment:"Override the foreground color; use 'terminal' for the terminal default."`
}

Jump to

Keyboard shortcuts

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