Documentation
¶
Index ¶
- Variables
- func Decode(name string, fn interface{}) (b bool)
- func DefaultFlags() *pflag.FlagSet
- func Init() (err error)
- func IsDev() bool
- func IsProd() bool
- func IsRelease() bool
- func IsStag() bool
- func IsTest() bool
- func Map(names ...string) map[string]interface{}
- func On(fn func(cfg *Config))
- func Template(format string) string
- func UnMarshal(path string) map[string]interface{}
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CfgType = "yaml" CfgName = "config" IsBlock = true Domain = "golug" CatchSigpipe = true Trace = false Port = 8080 DebugPort = 8088 Home = filepath.Join(xerror.PanicStr(filepath.Abs(filepath.Dir(""))), "home") CfgPath = "" Project = "golug" Level = "debug" Mode = RunMode.Dev Signal os.Signal = syscall.Signal(0) // RunEnvMode 项目运行模式 RunMode = struct { Dev string Test string Stag string Prod string Release string }{Dev: "dev", Test: "test", Stag: "stag", Prod: "prod", Release: "release"} )
默认的全局配置
Functions ¶
func DefaultFlags ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.