config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: MIT-0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigFiles = []string{
		path.Join(ConfigDir(), "mpdlrc/config.toml"),
	}
)

Functions

func ConfigDir

func ConfigDir() string

func HomeDir

func HomeDir() string

func HomeDirUser

func HomeDirUser(usr string) string

Types

type Config

type Config struct {
	MusicDir  string
	LyricsDir string
	Debug     bool

	MPD struct {
		Connection string
		Address    string
		Password   string
	}
}

func DefaultConfig

func DefaultConfig() (cfg *Config)

func (*Config) Assert

func (cfg *Config) Assert() error

Assert return error if Config is invalid.

func (*Config) Expand

func (cfg *Config) Expand()

Expand expands tilde ("~") and variables ("$VAR" or "${VAR}") in paths in Config. Sets LyricsDir to MusicDir if empty.

func (*Config) MergeTOMLFile

func (cfg *Config) MergeTOMLFile(fpath string) (err error)

MergeTOMLFile merges TOML file with Config.

Jump to

Keyboard shortcuts

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