Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgEnv ¶
type ArgEnv struct {
// contains filtered or unexported fields
}
ArgEnv represents the object used to process Environment and command line parameters.
func (*ArgEnv) Load ¶
func (e *ArgEnv) Load(o interface{})
Load will scan the structure provided and populate the structure using parameters passed via Environment variables or command line parameters. If no values are found in either location, then default values specified in the 'default' struct tag will be used to populate the structure.
It is important to note that Environment variables will take precedence over command line parameters.
type Entry ¶
type Entry struct { Name string // Name is the name of a field in a struct EnvName string // EnvName is the Environment variable name FlagName string // FlagName is the name of the command line parameter Type string // Type is the reflect.Type of the field Value reflect.Value // Value is the reflect.Value of the field Description string // Description is extracted from the 'description' struct tag for the field Default string // Default is extracted from the 'default' struct tag for the field }
Entry represents a single field in a struct.
Click to show internal directories.
Click to hide internal directories.