Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = ConfigFile{ Path: GetPath(), Config: Config{ Subs: []Subscription{}, Logs: "logs/log.txt", Cache: "cache", }, }
DefaultConfig is the configuration that will be saved in the configured path if no file is found on LoadConfig
Functions ¶
Types ¶
type Config ¶
type Config struct { Subs []Subscription `yaml:"subs"` Logs string `yaml:"logs"` Cache string `yaml:"cache"` }
Config represents all the configuration contained in a config file. It specifies the config schema.
var LoadedConfig Config
func (Config) GetByAlias ¶
func (c Config) GetByAlias(alias string) Subscription
GetByAlias returns the Subscription associated to the passed alias
type ConfigFile ¶
ConfigFile represents a file containing configuration
func LoadConfig ¶
func LoadConfig() (*ConfigFile, error)
LoadConfig checks the environment for a LAST_CONFIG_PATH_ON_THE_LEFT variable for a user supplied config path, if empty it puts it into $HOME/.config/LastPlayer. If no config is found at the specified path, the default config is placed there.
func (*ConfigFile) Include ¶
func (s *ConfigFile) Include(alias string, url string) error
Include allows the application to add subscriptions to the config
func (*ConfigFile) Save ¶
func (s *ConfigFile) Save() error
Save updates the config file that the config was loaded from with any changes
type Subscription ¶
Subscription represents a single alias <-> url pair. These are the items that show up in the feeds menu