Documentation
¶
Index ¶
Constants ¶
View Source
const ( AppName = "SomaFM CLI" AppTagline = "Terminal radio player" AppDescription = "A terminal-based music player for SomaFM radio stations" AppAuthor = "Ilya Glebov" AppAuthorURL = "https://ilyaglebov.dev" AppAuthorURLShort = "ilyaglebov.dev" AppProjectURL = "https://github.com/glebovdev/somafm-cli" AppProjectShort = "github.com/glebovdev/somafm-cli" AppDonateURL = "https://somafm.com/donate/" AppDonateShort = "somafm.com/donate" ConfigDir = ".config/somafm" ConfigFileName = "config.yml" DefaultVolume = 70 MinVolume = 0 MaxVolume = 100 )
Variables ¶
View Source
var AppVersion = "dev"
AppVersion can be overridden at build time using ldflags: go build -ldflags "-X github.com/glebovdev/somafm-cli/internal/config.AppVersion=1.0.0"
Functions ¶
func ClampVolume ¶
ClampVolume ensures volume is within the valid range [0, 100].
func GetConfigPath ¶
Types ¶
type Config ¶
type Config struct {
Volume int `yaml:"volume"`
LastStation string `yaml:"last_station"`
Autostart bool `yaml:"autostart"`
Favorites []string `yaml:"favorites"`
Theme Theme `yaml:"theme"`
}
func DefaultConfig ¶
func DefaultConfig() *Config
func (*Config) CleanupFavorites ¶
func (*Config) IsFavorite ¶
func (*Config) ToggleFavorite ¶
type Theme ¶
type Theme struct {
Background string `yaml:"background"`
Foreground string `yaml:"foreground"`
Borders string `yaml:"borders"`
Highlight string `yaml:"highlight"`
MutedVolume string `yaml:"muted_volume"`
HeaderBackground string `yaml:"header_background"`
StationListHeaderBackground string `yaml:"station_list_header_background"`
StationListHeaderForeground string `yaml:"station_list_header_foreground"`
HelpBackground string `yaml:"help_background"`
HelpForeground string `yaml:"help_foreground"`
HelpHotkey string `yaml:"help_hotkey"`
GenreTagBackground string `yaml:"genre_tag_background"`
ModalBackground string `yaml:"modal_background"`
}
Click to show internal directories.
Click to hide internal directories.