Documentation ¶
Index ¶
- Variables
- func CalculateFilename(track *deezer.Track, format deezer.Format) string
- func Configure(opts docopt.Opts, config *Configuration)
- func CreateConfig() error
- func Download(opts docopt.Opts, config *Configuration)
- func DownloadFile(url, outPath string) error
- func FileExists(path string) (bool, error)
- func FormatExtension(format deezer.Format) string
- func FormatStringToFormat(formatString string) deezer.Format
- func GetConfigDir() (string, error)
- type Configuration
- type EnvConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoEnvConfig = errors.New("unable to load environment variables")
Functions ¶
func CalculateFilename ¶ added in v0.2.0
func Configure ¶ added in v0.1.0
func Configure(opts docopt.Opts, config *Configuration)
func CreateConfig ¶
func CreateConfig() error
CreateConfig creates the config dir and config file if it doesn't exist
func Download ¶
func Download(opts docopt.Opts, config *Configuration)
Download reads arguments from docopt options to work out what to download
func DownloadFile ¶
func FileExists ¶
FileExists checks whether a file/directory exists
func FormatExtension ¶ added in v0.2.0
func FormatStringToFormat ¶ added in v0.1.0
func GetConfigDir ¶ added in v0.2.3
GetConfigDir returns the platform-specific configuration directory
Types ¶
type Configuration ¶
type Configuration struct { Version string `json:"version"` ARLCookie string `json:"arl"` DefaultFormat string `json:"default_format"` }
func NewConfiguration ¶
func NewConfiguration() *Configuration
NewConfiguration creates an empty, default config
func (*Configuration) SaveConfig ¶
func (config *Configuration) SaveConfig() error
SaveConfig saves the config object. The configuration file must already exist -- call CreateConfig first if this is not the case.
type EnvConfig ¶ added in v0.1.0
type EnvConfig struct {
DebugMode bool `envconfig:"DEBUG_MODE"`
}
func GetEnvConfig ¶ added in v0.1.0
func NewEnvConfig ¶ added in v0.1.0
func NewEnvConfig() *EnvConfig
Click to show internal directories.
Click to hide internal directories.