config

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: Apache-2.0 Imports: 22 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(""))), ".lava")
	CfgPath = ""
)
View Source
var ErrKeyNotFound = errors.New("config key not found")

Functions

func Decode

func Decode(name string, fn interface{}) error

func DefaultFlags

func DefaultFlags() []cli.Flag

func GetMap

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

func Init

func Init() error

Types

type Config

type Config interface {
	Decode(name string, fn interface{}) error
	Get(key string) interface{}
	Set(string, interface{})
	GetString(key string) string
	ConfigPath() string
	AllKeys() []string
	MergeConfig(in io.Reader) error
	All() map[string]interface{}
	GetMap(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