Documentation
¶
Overview ¶
Package config implements the Config structure, and holds related functions.
Index ¶
- Constants
- type Config
- func (cfg *Config) Assert() error
- func (cfg *Config) Expand()
- func (cfg *Config) FromClient(c client.Client)
- func (cfg *Config) FromEnv(env func(string) string)
- func (cfg *Config) FromFile(fpath string) error
- func (cfg *Config) FromFiles(files []string) error
- func (cfg *Config) FromOpts(opts docopt.Opts)
- func (cfg *Config) String() string
Constants ¶
View Source
const Debug = false
Debug is true for debug builds.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { LyricsDir string MusicDir string MPD struct { Address string Connection string Password string } }
Config holds the configuration.
func DefaultConfig ¶
func DefaultConfig() (cfg *Config)
DefaultConfig returns the default configuration.
func (*Config) Expand ¶
func (cfg *Config) Expand()
Expand expands tilde ("~") and variables ("$VAR" or "${VAR}") in paths in cfg. Sets LyricsDir to MusicDir if empty.
func (*Config) FromClient ¶ added in v0.6.0
FromClient merges the configuration from client.
func (*Config) FromOpts ¶ added in v0.7.1
func (cfg *Config) FromOpts(opts docopt.Opts)
FromOpts merges the configuration from docopt.Opts opts.
Click to show internal directories.
Click to hide internal directories.