config

package module
v0.0.0-...-e562d04 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const XDG_CONFIG_DIRS = "XDG_CONFIG_DIRS"
View Source
const XDG_CONFIG_HOME = "XDG_CONFIG_HOME"

Variables

This section is empty.

Functions

func Load

func Load(
	fileName string,
	opts interface{},
) error

Read one or more TOML configuration files and merge their contents. Merge overlays existing configuration settings and adds non-existing ones. The operation reads instances of the configuration file in an order opposite to the XDG Base Directory Specification to process the most "important" or higher preference directories last, thereby, ensuring their configuration values dominate the the resultant config file. This mechanism is analogous to static inhertance.

Notes

  • This function generates a typed error: "LoadFail", when it's unable to locate a single instance of the desired configuration file.

Types

type Duration

type Duration struct {
	time.Duration
}

TOML golang decoder requires extension to enable support of formatted golang duration strings.

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

type LoadFail

type LoadFail struct {
	printbuf.T
}

Generate concrete typed error to facilitate failure testing. Avoids parsing error message text that may change.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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