Documentation
¶
Index ¶
- type Field
- type Loader
- func (l *Loader) Build() *Loader
- func (l *Loader) FailOnNotParsedFlags() *Loader
- func (l *Loader) Flags() *flag.FlagSet
- func (l *Loader) Load(into interface{}) error
- func (l *Loader) LoadWithFile(into interface{}, file string) error
- func (l *Loader) SkipDefaults() *Loader
- func (l *Loader) SkipEnvironment() *Loader
- func (l *Loader) SkipFiles() *Loader
- func (l *Loader) SkipFlags() *Loader
- func (l *Loader) StopOnFileError() *Loader
- func (l *Loader) WalkFields(fn func(f Field) bool)
- func (l *Loader) WithEnvPrefix(prefix string) *Loader
- func (l *Loader) WithFiles(files []string) *Loader
- func (l *Loader) WithFlagPrefix(prefix string) *Loader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶ added in v0.4.0
type Field interface { // Name of the field. Name() string // DefaultValue of the field. DefaultValue() string // Usage of the field (set in `usage` tag). Usage() string // Tag returns a given tag for a field. Tag(tag string) string // Parent of the current node. Parent() (Field, bool) }
Field of the user configuration structure. Done as an interface to export less things in lib.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader of user configuration.
func LoaderFor ¶ added in v0.2.1
func LoaderFor(src interface{}) *Loader
LoaderFor creates a new Loader based on a given configuration structure.
func (*Loader) FailOnNotParsedFlags ¶ added in v0.5.1
FailOnNotParsedFlags to not forget parse flags explicitly. Use `l.FlagSet().Parse(os.Args[1:])` in your code for this.
func (*Loader) LoadWithFile ¶ added in v0.5.0
LoadWithFile configuration into a given param.
func (*Loader) SkipDefaults ¶ added in v0.2.1
SkipDefaults if you don't want to use them.
func (*Loader) SkipEnvironment ¶ added in v0.2.1
SkipEnvironment if you don't want to use it.
func (*Loader) StopOnFileError ¶ added in v0.5.0
StopOnFileError to stop configuration loading on file error.
func (*Loader) WalkFields ¶ added in v0.4.0
WalkFields iterates over configuration fields. Easy way to create documentation or other stuff.
func (*Loader) WithEnvPrefix ¶ added in v0.2.1
WithEnvPrefix to specify environment prefix.
func (*Loader) WithFlagPrefix ¶ added in v0.2.1
WithFlagPrefix to specify command-line flags prefix.
Directories
¶
Path | Synopsis |
---|---|
aconfigdotenv
module
|
|
aconfighcl
module
|
|
aconfigtoml
module
|
|
aconfigyaml
module
|