config

package
v2.0.29 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 18 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(path ...string) map[string]any

func Del

func Del(path string)

func Exists added in v2.0.14

func Exists(path string) bool

func Files

func Files() []string

func LoadEnv

func LoadEnv()

func LoadFile

func LoadFile(name string) error

func LoadFlags

func LoadFlags(fs *pflag.FlagSet)

func LoadMap

func LoadMap(m map[string]any)

func LoadStruct

func LoadStruct(v any, tag ...string)

func LoadedFile

func LoadedFile() string

func Raw

func Raw(path ...string) map[string]any

func Set

func Set(path string, value any)

func Unmarshal

func Unmarshal(path string, o any) error

Types

type Value

type Value interface {
	Any() any
	Int64(def ...int64) int64
	Int(def ...int) int
	Float64(def ...float64) float64
	Duration(def ...time.Duration) time.Duration
	Time(def ...time.Time) time.Time
	String(def ...string) string
	Bool(def ...bool) bool
}

func Get

func Get(path string) Value

func NewValue

func NewValue(v any) Value

Directories

Path Synopsis
internal
parsers/yaml
Package yaml implements a koanf.Parser that parses YAML bytes as conf maps.
Package yaml implements a koanf.Parser that parses YAML bytes as conf maps.
providers/confmap
Package confmap implements a koanf.Provider that takes nested and flat map[string]interface{} config maps and provides them to koanf.
Package confmap implements a koanf.Provider that takes nested and flat map[string]interface{} config maps and provides them to koanf.
providers/env
Package env implements a koanf.Provider that reads environment variables as conf maps.
Package env implements a koanf.Provider that reads environment variables as conf maps.
providers/file
Package file implements a koanf.Provider that reads raw bytes from files on disk to be used with a koanf.Parser to parse into conf maps.
Package file implements a koanf.Provider that reads raw bytes from files on disk to be used with a koanf.Parser to parse into conf maps.
providers/posflag
Package posflag implements a koanf.Provider that reads commandline parameters as conf maps using spf13/pflag, a POSIX compliant alternative to Go's stdlib flag package.
Package posflag implements a koanf.Provider that reads commandline parameters as conf maps using spf13/pflag, a POSIX compliant alternative to Go's stdlib flag package.
providers/structs
Package structs implements a koanf.Provider that takes a struct and tag and returns a nested config map (using fatih/structs) to provide it to koanf.
Package structs implements a koanf.Provider that takes a struct and tag and returns a nested config map (using fatih/structs) to provide it to koanf.

Jump to

Keyboard shortcuts

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