Documentation ¶
Index ¶
- Constants
- func Unmarshaler(dec *strdecode.Decoder) func(dst reflect.Value, typ reflect.Type, src string) error
- type Flag
- type FlagSet
- func (set *FlagSet) Bool(key string, value bool) *bool
- func (set *FlagSet) BoolVar(ptr *bool, key string, value bool)
- func (set *FlagSet) Bytes(key string, value []byte) *[]byte
- func (set *FlagSet) BytesVar(ptr *[]byte, key string, value []byte)
- func (set *FlagSet) Float(key string, value float64) *float64
- func (set *FlagSet) FloatVar(ptr *float64, key string, value float64)
- func (set *FlagSet) Int(key string, value int) *int
- func (set *FlagSet) Int64(key string, value int64) *int64
- func (set *FlagSet) Int64Var(ptr *int64, key string, value int64)
- func (set *FlagSet) IntVar(ptr *int, key string, value int)
- func (set *FlagSet) Parse(env []string) error
- func (set *FlagSet) ParseFile(src io.Reader) error
- func (set *FlagSet) String(key string, value string) *string
- func (set *FlagSet) StringVar(ptr *string, key string, value string)
- func (set *FlagSet) StructFields(dst interface{})
- func (set *FlagSet) Uint(key string, value uint) *uint
- func (set *FlagSet) Uint64(key string, value uint64) *uint64
- func (set *FlagSet) Uint64Var(ptr *uint64, key string, value uint64)
- func (set *FlagSet) UintVar(ptr *uint, key string, value uint)
- func (set *FlagSet) Validate() error
- func (set *FlagSet) Var(dst interface{}, key, value string)
- type Flags
- type InvalidFlagError
Constants ¶
View Source
const EnvTag = "env"
Env var struct tag.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Flag ¶
type FlagSet ¶
type FlagSet struct { // Flags should contain possible keys to be searched for when parsing env vars. Flags Flags // Unmarshal should unmarshal possible environment value into 'dst'. Unmarshal func(dst reflect.Value, typ reflect.Type, src string) error }
func (*FlagSet) Parse ¶
Parse ... will parse value strings from env vars slice, storing in the Decoder before call to Decode().
func (*FlagSet) StructFields ¶
func (set *FlagSet) StructFields(dst interface{})
type Flags ¶
type Flags []Flag
Flags provides helpful methods for a slice of flags.
func (Flags) AppendFormat ¶
AppendFormat will append a new-line separated string representation of Flags to b.
type InvalidFlagError ¶
InvalidFlagError encapsulates error information regarding an invalid flag when calling env.Flags{}.Validate().
func (*InvalidFlagError) Error ¶
func (err *InvalidFlagError) Error() string
Click to show internal directories.
Click to hide internal directories.