source

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHoardConfigFileName = "hoard.conf"
View Source
const DefaultJSONConfigEnvironmentVariable = "HOARD_JSON_CONFIG"
View Source
const STDINFileIdentifier = "-"

Variables

This section is empty.

Functions

func Cascade

func Cascade(logWriter io.Writer, shortCircuit bool, sources ...ConfigProvider) *configSource

func Default

func Default() *configSource

func Environment

func Environment(key string) *configSource

Source from a single environment variable with config embedded in JSON

func File

func File(configFile string) *configSource

Source from file

func XDGBaseDir

func XDGBaseDir() *configSource

Try to find config by using XDG base dir spec

Types

type ConfigProvider

type ConfigProvider interface {
	// Description of where this provider sources its config from
	From() string
	// Get the config possibly overriding values passed in from baseConfig
	Get(baseConfig *config.HoardConfig) (*config.HoardConfig, error)
	// Return a copy of the provider that does nothing if skip is true
	SetSkip(skip bool) ConfigProvider
	// Whether to skip this provider
	Skip() bool
}

Jump to

Keyboard shortcuts

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