config

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT-0 Imports: 10 Imported by: 0

Documentation

Overview

Package config implements the Config structure, and holds related functions.

Index

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) Assert

func (cfg *Config) Assert() error

Assert return error if cfg is invalid.

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

func (cfg *Config) FromClient(c client.Client)

FromClient merges the configuration from client.

func (*Config) FromEnv added in v0.7.1

func (cfg *Config) FromEnv(env func(string) string)

FromEnv merges the configuration from env.

func (*Config) FromFile added in v0.7.1

func (cfg *Config) FromFile(fpath string) error

FromFile merges the configuration from fpath.

func (*Config) FromFiles added in v0.7.1

func (cfg *Config) FromFiles(files []string) error

FromFiles merges the configuration fore files.

func (*Config) FromOpts added in v0.7.1

func (cfg *Config) FromOpts(opts docopt.Opts)

FromOpts merges the configuration from docopt.Opts opts.

func (*Config) String added in v0.6.0

func (cfg *Config) String() string

Jump to

Keyboard shortcuts

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