config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConfigNotLoaded = errors.New("config not loaded")

Functions

func Get

func Get(key string, out interface{}) error

Get populates out with the configuration at the given key. Populate out with default values before calling this function to ensure sane defaults if there are any.

func GetSection

func GetSection(section Section) error

GetSection populates a config section.

func Load

func Load(confFile string, overrides map[string]interface{}) error

Load loads the config file at the given path.

func LoadAndWatch

func LoadAndWatch(ctx context.Context, confFile string, overrides map[string]interface{}) error

LoadAndWatch automatically reloads configuration if the config file changes.

func LoadMap

func LoadMap(m map[string]interface{}) error

func LoadReader

func LoadReader(reader io.Reader) error

Types

type Defaulter

type Defaulter interface {
	SetDefaults()
}

type Section

type Section interface {
	Key() string
}

type Validator

type Validator interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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