kv

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 52

Documentation

Index

Constants

View Source
const EnvViperConfigFile = "KV_VIPER_FILE"

Variables

View Source
var ErrNoBackends = errors.New("no backends configured")

Functions

func MustGetStringMap

func MustGetStringMap(getter Getter, key string) map[string]interface{}

Types

type Getter

type Getter interface {
	// GetStringMap expected to return nil if key does not exist
	GetStringMap(key string) (map[string]interface{}, error)
}

func FromEnv

func FromEnv() (Getter, error)

func MergeGetters

func MergeGetters(backends ...Getter) Getter

func MustFromEnv

func MustFromEnv() Getter

func NewViperFile

func NewViperFile(fn string) Getter

type GetterFunc added in v1.11.0

type GetterFunc func(key string) (map[string]interface{}, error)

The GetterFunc type is an adapter to allow the use of ordinary functions as Getter. If f is a function with the appropriate signature, GetterFunc(f) is a Getter that calls f.

func (GetterFunc) GetStringMap added in v1.11.0

func (f GetterFunc) GetStringMap(key string) (map[string]interface{}, error)

GetStringMap calls f(key).

Jump to

Keyboard shortcuts

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