Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotStructPointer is returned when the provided target is not a struct pointer. ErrNotStructPointer = fmt.Errorf("target is not a struct pointer") )
Functions ¶
This section is empty.
Types ¶
type ILoader ¶
type ILoader interface {
// Load loads the configs into the provided struct.
//
// The target should be a struct pointer. The struct fields may have three tags:
// "default", "env" and "arg".
//
// 1. The "default" tag will be accepted as the default value of the field.
//
// 2. The "env" tag should hold the name of environment variable bound to the field.
//
// 3. The "arg" tag should hold the name of the command-line flag bound to the field. Example:
// $ <script> --arg-name=value
//
// The order of priority is "arg" > "env" > "default".
Load(target interface{}) error
// contains filtered or unexported methods
}
ILoader represents a configuration loader.
Click to show internal directories.
Click to hide internal directories.