config

package
v0.0.0-...-ee57bd3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Unmarshal      = defaultConfig.Unmarshal
	Scan           = defaultConfig.Scan
	Get            = defaultConfig.Get
	GetString      = defaultConfig.GetString
	GetBool        = defaultConfig.GetBool
	GetInt         = defaultConfig.GetInt
	GetFloat64     = defaultConfig.GetFloat64
	GetDuration    = defaultConfig.GetDuration
	GetIntSlice    = defaultConfig.GetIntSlice
	GetStringSlice = defaultConfig.GetStringSlice
	GetStringMap   = defaultConfig.GetStringMap
	OnChange       = defaultConfig.OnChange
)

Functions

func ResetDefault

func ResetDefault(c Config)

Types

type Config

type Config interface {
	Unmarshal(val any) error
	Scan(key string, val any) error
	Get(key string) any
	GetString(key string) string
	GetBool(key string) bool
	GetInt(key string) int
	GetFloat64(key string) float64
	GetDuration(key string) time.Duration
	GetIntSlice(key string) []int
	GetStringSlice(key string) []string
	GetStringMap(key string) map[string]any
	OnChange(f OnChangeFunc)
}

func Default

func Default() Config

func New

func New() Config

type OnChangeFunc

type OnChangeFunc func(Config)

Jump to

Keyboard shortcuts

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