internal

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

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 CalculateFilename(track *deezer.Track, format deezer.Format) string

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 DownloadFile(url, outPath string) error

func FileExists

func FileExists(path string) (bool, error)

FileExists checks whether a file/directory exists

func FormatExtension added in v0.2.0

func FormatExtension(format deezer.Format) string

func FormatStringToFormat added in v0.1.0

func FormatStringToFormat(formatString string) deezer.Format

func GetConfigDir added in v0.2.3

func GetConfigDir() (string, error)

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 LoadConfig

func LoadConfig() (*Configuration, error)

LoadConfig loads the configuration file

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 GetEnvConfig() (*EnvConfig, error)

func NewEnvConfig added in v0.1.0

func NewEnvConfig() *EnvConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL