Documentation
¶
Index ¶
- Constants
- type EnvConfig
- func (ec *EnvConfig) AddPath(path string) int
- func (ec *EnvConfig) ClearPath()
- func (ec *EnvConfig) EnableDebugLog(debug, warn func(format string, a ...interface{}))
- func (ec *EnvConfig) EnableLogWithDefaultLogger()
- func (ec *EnvConfig) EnableUserLog(user func(format string, a ...interface{}))
- func (ec *EnvConfig) LoadConfig(cfg interface{}) error
- func (ec *EnvConfig) UseStrict()
- type LogFunc
Constants ¶
const ( OverwriteAll mapMergeType = iota KeyMerge ValueMerge )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnvConfig ¶ added in v0.3.0
type EnvConfig struct {
// contains filtered or unexported fields
}
EnvConfig is main struct of EnvConfig. Use envconfig.New() to get instance.
func New ¶ added in v0.3.0
func New() *EnvConfig
Always use this method to get instance of EnvConfig
func (*EnvConfig) AddPath ¶ added in v0.3.0
AddPath adds config read path.
every path not needs to be existed. If file not found on path, its simply ignored.
Same config are overwrite by last added config file. returns path count added
func (*EnvConfig) ClearPath ¶ added in v0.3.0
func (ec *EnvConfig) ClearPath()
ClearPath clear all paths added by AddPath()
func (*EnvConfig) EnableDebugLog ¶ added in v0.3.0
EnableDebugLog enables logging with specified log output function. Not output log if function is Nil
func (*EnvConfig) EnableLogWithDefaultLogger ¶ added in v0.3.0
func (ec *EnvConfig) EnableLogWithDefaultLogger()
EnableLogWithDefaultLogger enables logging with fmt.Printf output.
func (*EnvConfig) EnableUserLog ¶ added in v0.3.0
EnableUserLog enables log message for users.
func (*EnvConfig) LoadConfig ¶ added in v0.3.0
LoadConfig starts config process parameter must be pointer of struct entity
cause panic: * coding error * internal error
return error: * config value error