config

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type App added in v0.2.2

type App struct {
	Debug     bool   `yaml:"debug"`
	Addr      string `yaml:"addr"`
	Advertise string `yaml:"advertise"`
}

func (*App) Check added in v0.2.2

func (c *App) Check() (err error)

type CfgMap added in v0.1.26

type CfgMap map[string]interface{}

func (CfgMap) Decode added in v0.1.26

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

func (CfgMap) GetString added in v0.2.3

func (t CfgMap) GetString(name string) string

type Config

type Config interface {
	LoadPath(path string)
	LoadEnv(names ...string)
	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{}
}

Jump to

Keyboard shortcuts

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