Documentation ¶
Index ¶
- Variables
- func GetConfigDir(dir string) (string, error)
- func GetOptionValue(key string) string
- func GetPath(ftype string, nocreate ...struct{}) (string, error)
- func GetQueryParams(queryType string) (string, string, error)
- func Init()
- func IsOptionEnabled(key string) bool
- func PrintError(message string, err ...error)
- func RegisterConfigHandler(h ConfigHandler, i ConfigType)
- func RunAllGenerators(genMap map[string]interface{})
- func RunAllParsers()
- func SaveSettings()
- func SetOptionValue(key string, value interface{})
- type Config
- type ConfigHandler
- type ConfigSettings
- type ConfigType
- type Option
- type PlayHistorySettings
- type Printer
- type SettingsData
Constants ¶
This section is empty.
Variables ¶
var Version string
Version stores the version information.
Functions ¶
func GetConfigDir ¶ added in v0.3.8
GetConfigDir returns the full config path for the provided directory.
func GetOptionValue ¶
GetOptionValue returns a value for an option from the configuration store.
func GetQueryParams ¶
GetQueryParams returns the parameters for the search and play option types.
func IsOptionEnabled ¶
IsOptionEnabled returns if an option is enabled.
func PrintError ¶
PrintError prints an error to the screen.
func RegisterConfigHandler ¶ added in v0.3.8
func RegisterConfigHandler(h ConfigHandler, i ConfigType)
RegisterConfigHandler registers a configuration handler.
func RunAllGenerators ¶ added in v0.3.8
func RunAllGenerators(genMap map[string]interface{})
RunAllGenerators runs all the stored handler's generators.
func RunAllParsers ¶ added in v0.3.8
func RunAllParsers()
RunAllParsers runs all the stored handler's parsers.
func SaveSettings ¶ added in v0.3.3
func SaveSettings()
SaveSettings saves the application settings.
func SetOptionValue ¶
func SetOptionValue(key string, value interface{})
SetOptionValue sets a value for an option in the configuration store.
Types ¶
type Config ¶
type Config struct { *koanf.Koanf // contains filtered or unexported fields }
Config describes the configuration for the app.
type ConfigHandler ¶ added in v0.3.8
type ConfigHandler interface { Parse(k *koanf.Koanf, dir string) error Generate(k *koanf.Koanf) (interface{}, error) }
ConfigHandler describes a configuration handler.
type ConfigSettings ¶ added in v0.3.8
type ConfigSettings struct {
// contains filtered or unexported fields
}
ConfigSettings stores the configuration handlers.
type ConfigType ¶ added in v0.3.8
type ConfigType string
ConfigType describes the configuration type.
const ( ConfigTheme ConfigType = "theme" ConfigKeybindings ConfigType = "keybindings" )
The different types of configuration handlers.
type PlayHistorySettings ¶ added in v0.3.3
type PlayHistorySettings struct { Type string `json:"type"` Title string `json:"title"` Author string `json:"author"` VideoID string `json:"videoId"` PlaylistID string `json:"playlistId"` AuthorID string `json:"authorId"` }
PlayHistorySettings describes the format to store the play history.
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer describes the terminal printing configuration.
type SettingsData ¶ added in v0.3.3
type SettingsData struct { Credentials []client.Credential `json:"credentials"` SearchHistory []string `json:"searchHistory"` PlayHistory []PlayHistorySettings `json:"playHistory"` PlayerStates []string `json:"playerStates"` }
SettingsData describes the format to store the application settings.
var Settings SettingsData
Settings stores the application settings.