config

package
v0.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CfgType = "yaml"
	CfgName = "config"
	Home    = filepath.Join(xerror.PanicStr(filepath.Abs(filepath.Dir(""))), "home")
	CfgPath = ""
)

Functions

func Decode

func Decode(name string, fn interface{}) (b bool)

func DefaultFlags

func DefaultFlags() *pflag.FlagSet

func GetMap added in v0.0.21

func GetMap(keys ...string) map[string]interface{}

func Init

func Init() error

func On

func On(fn func(cfg Config))

Types

type Config

type Config interface {
	Get(key string) interface{}
	Set(string, interface{})
	GetString(key string) string
	ConfigFileUsed() string
	AllKeys() []string
	MergeConfig(in io.Reader) error
	AllSettings() map[string]interface{}
	GetStringMap(key string) map[string]interface{}
}

func GetCfg

func GetCfg() Config

Jump to

Keyboard shortcuts

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