config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CfgType = "yaml"
	CfgName = "config"
	CfgDir  = ""
	CfgPath = filepath.Join("configs", "config", "config.yaml")
)

Functions

func Decode

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

func Get added in v0.2.0

func Get(key string) interface{}

func GetString added in v0.2.0

func GetString(key string) string

func UnmarshalKey added in v0.2.0

func UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error

Types

type CfgMap added in v0.1.26

type CfgMap map[string]interface{}

func GetMap

func GetMap(keys ...string) CfgMap

func (CfgMap) Decode added in v0.1.26

func (t CfgMap) Decode(val interface{}) error

type Config

type Config interface {
	UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
	Decode(name string, cfgMap interface{}) error
	Get(key string) interface{}
	Set(string, interface{})
	GetString(key string) string
	GetMap(keys ...string) CfgMap
	AllKeys() []string
	MergeConfig(in io.Reader) error
	All() map[string]interface{}
}

func GetCfg

func GetCfg() Config

GetCfg 获取内存配置

Jump to

Keyboard shortcuts

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