Documentation ¶
Overview ¶
Package env provides a similar interface for environment variables as flag/pflag package.
The reason for this is to make configuration management in a CLI application as easy as possible. Environment variables are mostly used in server applications (eg. apps running in docker) though, so this solution is mostly beneficial for them.
Use this package along with the flag package from the stdlib or the POSIX compliant pflag (github.com/spf13/pflag) library. The general recommendation is to let flags take precedence over environment variables (when it makes sense to accept a configuration via both methods). To achieve this, make sure to parse flags after environment variables.
Here is an example for a regular application using both flags and environment variables:
package main import ( flag "github.com/spf13/pflag" "github.com/goph/env" ) func main() { var debug bool // Flags listen := flag.String("listen", ":8080", "Listen on this port") flag.BoolVar(&debug, "debug", false, "Whether to serve extra debug information in logs") // Env vars env.BoolVar(&debug, "debug", false, "Whether to serve extra debug information in logs") err := env.Parse() if err != nil { panic(err) } err = flag.Parse() if err != nil { panic(err) } // ... further code }
Index ¶
- Variables
- func Bool(name string, value bool, usage string) *bool
- func BoolVar(p *bool, name string, value bool, usage string)
- func Duration(name string, value time.Duration, usage string) *time.Duration
- func DurationVar(p *time.Duration, name string, value time.Duration, usage string)
- func Float32(name string, value float32, usage string) *float32
- func Float32Var(p *float32, name string, value float32, usage string)
- func Float64(name string, value float64, usage string) *float64
- func Float64Var(p *float64, name string, value float64, usage string)
- func Int(name string, value int, usage string) *int
- func Int16(name string, value int16, usage string) *int16
- func Int16Var(p *int16, name string, value int16, usage string)
- func Int32(name string, value int32, usage string) *int32
- func Int32Var(p *int32, name string, value int32, usage string)
- func Int64(name string, value int64, usage string) *int64
- func Int64Var(p *int64, name string, value int64, usage string)
- func Int8(name string, value int8, usage string) *int8
- func Int8Var(p *int8, name string, value int8, usage string)
- func IntVar(p *int, name string, value int, usage string)
- func Parse()
- func Parsed() bool
- func PrintDefaults()
- func QueryString(name string, value map[string]string, usage string) *map[string]string
- func QueryStringVar(p *map[string]string, name string, value map[string]string, usage string)
- func String(name string, value string, usage string) *string
- func StringSlice(name string, value []string, usage string) *[]string
- func StringSliceVar(p *[]string, name string, value []string, usage string)
- func StringVar(p *string, name string, value string, usage string)
- func Uint(name string, value uint, usage string) *uint
- func Uint16(name string, value uint16, usage string) *uint16
- func Uint16Var(p *uint16, name string, value uint16, usage string)
- func Uint32(name string, value uint32, usage string) *uint32
- func Uint32Var(p *uint32, name string, value uint32, usage string)
- func Uint64(name string, value uint64, usage string) *uint64
- func Uint64Var(p *uint64, name string, value uint64, usage string)
- func Uint8(name string, value uint8, usage string) *uint8
- func Uint8Var(p *uint8, name string, value uint8, usage string)
- func UintVar(p *uint, name string, value uint, usage string)
- func UnquoteUsage(envVar *EnvVar) (name string, usage string)
- func Var(value Value, name string, usage string)
- func VisitAll(fn func(*EnvVar))
- type EnvVar
- type EnvVarSet
- func (s *EnvVarSet) AddEnvVar(envVar *EnvVar)
- func (s *EnvVarSet) Bool(name string, value bool, usage string) *bool
- func (s *EnvVarSet) BoolVar(p *bool, name string, value bool, usage string)
- func (s *EnvVarSet) Duration(name string, value time.Duration, usage string) *time.Duration
- func (s *EnvVarSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string)
- func (s *EnvVarSet) EnvVarUsages() string
- func (s *EnvVarSet) EnvVarUsagesWrapped(cols int) string
- func (s *EnvVarSet) Float32(name string, value float32, usage string) *float32
- func (s *EnvVarSet) Float32Var(p *float32, name string, value float32, usage string)
- func (s *EnvVarSet) Float64(name string, value float64, usage string) *float64
- func (s *EnvVarSet) Float64Var(p *float64, name string, value float64, usage string)
- func (s *EnvVarSet) GetNormalizeFunc() NormalizeFunc
- func (s *EnvVarSet) HasEnvVars() bool
- func (s *EnvVarSet) Int(name string, value int, usage string) *int
- func (s *EnvVarSet) Int16(name string, value int16, usage string) *int16
- func (s *EnvVarSet) Int16Var(p *int16, name string, value int16, usage string)
- func (s *EnvVarSet) Int32(name string, value int32, usage string) *int32
- func (s *EnvVarSet) Int32Var(p *int32, name string, value int32, usage string)
- func (s *EnvVarSet) Int64(name string, value int64, usage string) *int64
- func (s *EnvVarSet) Int64Var(p *int64, name string, value int64, usage string)
- func (s *EnvVarSet) Int8(name string, value int8, usage string) *int8
- func (s *EnvVarSet) Int8Var(p *int8, name string, value int8, usage string)
- func (s *EnvVarSet) IntVar(p *int, name string, value int, usage string)
- func (s *EnvVarSet) Lookup(name string) *EnvVar
- func (s *EnvVarSet) Parse(environment map[string]string) error
- func (s *EnvVarSet) ParseEnviron(environ []string) error
- func (s *EnvVarSet) Parsed() bool
- func (s *EnvVarSet) PrintDefaults()
- func (s *EnvVarSet) QueryString(name string, value map[string]string, usage string) *map[string]string
- func (s *EnvVarSet) QueryStringVar(p *map[string]string, name string, value map[string]string, usage string)
- func (s *EnvVarSet) SetNormalizeFunc(fn NormalizeFunc)
- func (s *EnvVarSet) SetOutput(output io.Writer)
- func (s *EnvVarSet) String(name string, value string, usage string) *string
- func (s *EnvVarSet) StringSlice(name string, value []string, usage string) *[]string
- func (s *EnvVarSet) StringSliceVar(p *[]string, name string, value []string, usage string)
- func (s *EnvVarSet) StringVar(p *string, name string, value string, usage string)
- func (s *EnvVarSet) Uint(name string, value uint, usage string) *uint
- func (s *EnvVarSet) Uint16(name string, value uint16, usage string) *uint16
- func (s *EnvVarSet) Uint16Var(p *uint16, name string, value uint16, usage string)
- func (s *EnvVarSet) Uint32(name string, value uint32, usage string) *uint32
- func (s *EnvVarSet) Uint32Var(p *uint32, name string, value uint32, usage string)
- func (s *EnvVarSet) Uint64(name string, value uint64, usage string) *uint64
- func (s *EnvVarSet) Uint64Var(p *uint64, name string, value uint64, usage string)
- func (s *EnvVarSet) Uint8(name string, value uint8, usage string) *uint8
- func (s *EnvVarSet) Uint8Var(p *uint8, name string, value uint8, usage string)
- func (s *EnvVarSet) UintVar(p *uint, name string, value uint, usage string)
- func (s *EnvVarSet) Var(value Value, name string, usage string)
- func (s *EnvVarSet) VarE(value Value, name string, usage string) *EnvVar
- func (s *EnvVarSet) VisitAll(fn func(*EnvVar))
- type ErrorHandling
- type NormalizeFunc
- type NormalizedName
- type Value
Constants ¶
This section is empty.
Variables ¶
var Environment = NewEnvVarSet(ExitOnError)
Environment is the default set of environment variables, parsed from os.Environ().
Functions ¶
func Bool ¶
Bool defines a bool environment variable with specified name, default value, and usage string. The return value is the address of a bool variable that stores the value of the environment variable.
func BoolVar ¶
BoolVar defines a bool environment variable with specified name, default value, and usage string. The argument p points to a bool variable in which to store the value of the environment variable.
func Duration ¶
Duration defines a time.Duration environment variable with specified name, default value, and usage string. The return value is the address of a time.Duration variable that stores the value of the environment variable.
func DurationVar ¶
DurationVar defines a time.Duration environment variable with specified name, default value, and usage string. The argument p points to a time.Duration variable in which to store the value of the environment variable.
func Float32 ¶
Float32 defines a float32 environment variable with specified name, default value, and usage string. The return value is the address of a float32 variable that stores the value of the environment variable.
func Float32Var ¶
Float32Var defines a float32 environment variable with specified name, default value, and usage string. The argument p points to a float32 variable in which to store the value of the environment variable.
func Float64 ¶
Float64 defines a float64 environment variable with specified name, default value, and usage string. The return value is the address of a float64 variable that stores the value of the environment variable.
func Float64Var ¶
Float64Var defines a float64 environment variable with specified name, default value, and usage string. The argument p points to a float64 variable in which to store the value of the environment variable.
func Int ¶
Int defines an int environment variable with specified name, default value, and usage string. The return value is the address of an int variable that stores the value of the environment variable.
func Int16 ¶
Int16 defines an int16 environment variable with specified name, default value, and usage string. The return value is the address of an int16 variable that stores the value of the environment variable.
func Int16Var ¶
Int16Var defines an int16 environment variable with specified name, default value, and usage string. The argument p points to an int16 variable in which to store the value of the environment variable.
func Int32 ¶
Int32 defines an int32 environment variable with specified name, default value, and usage string. The return value is the address of an int32 variable that stores the value of the environment variable.
func Int32Var ¶
Int32Var defines an int32 environment variable with specified name, default value, and usage string. The argument p points to an int32 variable in which to store the value of the environment variable.
func Int64 ¶
Int64 defines an int64 environment variable with specified name, default value, and usage string. The return value is the address of an int64 variable that stores the value of the environment variable.
func Int64Var ¶
Int64Var defines an int64 environment variable with specified name, default value, and usage string. The argument p points to an int64 variable in which to store the value of the environment variable.
func Int8 ¶
Int8 defines an int8 environment variable with specified name, default value, and usage string. The return value is the address of an int8 variable that stores the value of the environment variable.
func Int8Var ¶
Int8Var defines an int8 environment variable with specified name, default value, and usage string. The argument p points to an int8 variable in which to store the value of the environment variable.
func IntVar ¶
IntVar defines an int environment variable with specified name, default value, and usage string. The argument p points to an int variable in which to store the value of the environment variable.
func Parse ¶
func Parse()
Parse parses environment variables from os.Environ() according to the definitions in the EnvVarSet. Must be called after all variables in the EnvVarSet are defined and before variables are accessed by the program.
func PrintDefaults ¶ added in v0.5.0
func PrintDefaults()
PrintDefaults prints to standard error the default values of all defined environment variables.
func QueryString ¶ added in v0.5.0
QueryString defines a query string environment variable with specified name, default value, and usage string. The return value is the address of a query string (string map) variable that stores the value of the environment variable.
func QueryStringVar ¶ added in v0.5.0
QueryStringVar defines a query string environment variable with specified name, default value, and usage string. The argument p points to a query string (string map) variable in which to store the value of the environment variable.
func String ¶
String defines a string environment variable with specified name, default value, and usage string. The return value is the address of a string variable that stores the value of the environment variable.
func StringSlice ¶ added in v0.6.0
StringSlice defines a string environment variable with specified name, default value, and usage string. The return value is the address of a []string variable that stores the value of the environment variable. For example:
STRING_SLICE="v1,v2"
will result in
[]string{"v1", "v2"}
func StringSliceVar ¶ added in v0.6.0
StringSliceVar defines a string environment variable with specified name, default value, and usage string. The argument p points to a []string variable in which to store the value of the environment variable. For example:
STRING_SLICE="v1,v2"
will result in
[]string{"v1", "v2"}
func StringVar ¶
StringVar defines a string environment variable with specified name, default value, and usage string. The argument p points to a string variable in which to store the value of the environment variable.
func Uint ¶
Uint defines a uint environment variable with specified name, default value, and usage string. The return value is the address of a uint variable that stores the value of the environment variable.
func Uint16 ¶
Uint16 defines a uint16 environment variable with specified name, default value, and usage string. The return value is the address of a uint16 variable that stores the value of the environment variable.
func Uint16Var ¶
Uint16Var defines a uint16 environment variable with specified name, default value, and usage string. The argument p points to a uint16 variable in which to store the value of the environment variable.
func Uint32 ¶
Uint32 defines a uint32 environment variable with specified name, default value, and usage string. The return value is the address of a uint32 variable that stores the value of the environment variable.
func Uint32Var ¶
Uint32Var defines a uint32 environment variable with specified name, default value, and usage string. The argument p points to a uint32 variable in which to store the value of the environment variable.
func Uint64 ¶
Uint64 defines a uint64 environment variable with specified name, default value, and usage string. The return value is the address of a uint64 variable that stores the value of the environment variable.
func Uint64Var ¶
Uint64Var defines a uint64 environment variable with specified name, default value, and usage string. The argument p points to a uint64 variable in which to store the value of the environment variable.
func Uint8 ¶
Uint8 defines a uint8 environment variable with specified name, default value, and usage string. The return value is the address of a uint8 variable that stores the value of the environment variable.
func Uint8Var ¶
Uint8Var defines a uint8 environment variable with specified name, default value, and usage string. The argument p points to a uint8 variable in which to store the value of the environment variable.
func UintVar ¶
UintVar defines a uint environment variable with specified name, default value, and usage string. The argument p points to a uint variable in which to store the value of the environment variable.
func UnquoteUsage ¶ added in v0.4.0
UnquoteUsage extracts a back-quoted name from the usage string for an environment variable and returns it and the un-quoted usage. Given "a `name` to show" it returns ("name", "a name to show"). If there are no back quotes, the name is an educated guess of the type of the environment variable's value.
func Var ¶
Var defines an environment variable with the specified name and usage string. The type and value of the variable are represented by the first argument, of type Value, which typically holds a user-defined implementation of Value. For instance, the caller could create an environment variable that turns a comma-separated string into a slice of strings by giving the slice the methods of Value; in particular, Set would decompose the comma-separated string into the slice.
Types ¶
type EnvVar ¶ added in v0.2.0
type EnvVar struct { // Name of the environment variable Name string // Usage message Usage string // Value as set Value Value // DefaultValue is shown in the usage message DefaultValue string }
EnvVar represents the state of an environment variable.
type EnvVarSet ¶
type EnvVarSet struct { // SortVars is used to indicate, if user wants to have sorted environment variables in // help/usage messages. SortVars bool // contains filtered or unexported fields }
EnvVarSet is a set of defined environment variables.
func NewEnvVarSet ¶
func NewEnvVarSet(errorHandling ErrorHandling) *EnvVarSet
NewEnvVarSet returns a new, empty environment variable set with the specified error handling property and SortFlags set to true.
func (*EnvVarSet) AddEnvVar ¶ added in v0.2.0
AddEnvVar will add the environment variable to the EnvVarSet.
func (*EnvVarSet) Bool ¶
Bool defines a bool environment variable with specified name, default value, and usage string. The return value is the address of a bool variable that stores the value of the environment variable.
func (*EnvVarSet) BoolVar ¶
BoolVar defines a bool environment variable with specified name, default value, and usage string. The argument p points to a bool variable in which to store the value of the environment variable.
func (*EnvVarSet) Duration ¶
Duration defines a time.Duration environment variable with specified name, default value, and usage string. The return value is the address of a time.Duration variable that stores the value of the environment variable.
func (*EnvVarSet) DurationVar ¶
DurationVar defines a time.Duration environment variable with specified name, default value, and usage string. The argument p points to a time.Duration variable in which to store the value of the environment variable.
func (*EnvVarSet) EnvVarUsages ¶ added in v0.4.0
EnvVarUsages returns a string containing the usage information for all environment variables in the set.
func (*EnvVarSet) EnvVarUsagesWrapped ¶ added in v0.5.0
EnvVarUsages returns a string containing the usage information for all environment variables in the set. Wrapped to `cols` columns (0 for no wrapping)
func (*EnvVarSet) Float32 ¶
Float32 defines a float32 environment variable with specified name, default value, and usage string. The return value is the address of a float32 variable that stores the value of the environment variable.
func (*EnvVarSet) Float32Var ¶
Float32Var defines a float32 environment variable with specified name, default value, and usage string. The argument p points to a float32 variable in which to store the value of the environment variable.
func (*EnvVarSet) Float64 ¶
Float64 defines a float64 environment variable with specified name, default value, and usage string. The return value is the address of a float64 variable that stores the value of the environment variable.
func (*EnvVarSet) Float64Var ¶
Float64Var defines a float64 environment variable with specified name, default value, and usage string. The argument p points to a float64 variable in which to store the value of the environment variable.
func (*EnvVarSet) GetNormalizeFunc ¶ added in v0.3.0
func (s *EnvVarSet) GetNormalizeFunc() NormalizeFunc
GetNormalizeFunc returns the previously set NormalizeFunc. If not set, it returns the default normalization function.
func (*EnvVarSet) HasEnvVars ¶ added in v0.5.0
HasEnvVars returns a bool to indicate if the EnvVarSet has any environment variables defined.
func (*EnvVarSet) Int ¶
Int defines an int environment variable with specified name, default value, and usage string. The return value is the address of an int variable that stores the value of the environment variable.
func (*EnvVarSet) Int16 ¶
Int16 defines an int16 environment variable with specified name, default value, and usage string. The return value is the address of an int16 variable that stores the value of the environment variable.
func (*EnvVarSet) Int16Var ¶
Int16Var defines an int16 environment variable with specified name, default value, and usage string. The argument p points to an int16 variable in which to store the value of the environment variable.
func (*EnvVarSet) Int32 ¶
Int32 defines an int32 environment variable with specified name, default value, and usage string. The return value is the address of an int32 variable that stores the value of the environment variable.
func (*EnvVarSet) Int32Var ¶
Int32Var defines an int32 environment variable with specified name, default value, and usage string. The argument p points to an int32 variable in which to store the value of the environment variable.
func (*EnvVarSet) Int64 ¶
Int64 defines an int64 environment variable with specified name, default value, and usage string. The return value is the address of an int64 variable that stores the value of the environment variable.
func (*EnvVarSet) Int64Var ¶
Int64Var defines an int64 environment variable with specified name, default value, and usage string. The argument p points to an int64 variable in which to store the value of the environment variable.
func (*EnvVarSet) Int8 ¶
Int8 defines an int8 environment variable with specified name, default value, and usage string. The return value is the address of an int8 variable that stores the value of the environment variable.
func (*EnvVarSet) Int8Var ¶
Int8Var defines an int8 environment variable with specified name, default value, and usage string. The argument p points to an int8 variable in which to store the value of the environment variable.
func (*EnvVarSet) IntVar ¶
IntVar defines an int environment variable with specified name, default value, and usage string. The argument p points to an int variable in which to store the value of the environment variable.
func (*EnvVarSet) Lookup ¶ added in v0.7.0
Lookup returns the EnvVar structure of the named environment variable, returning nil if none exists.
func (*EnvVarSet) Parse ¶
Parse parses environment variables according to the definitions in the EnvVarSet. Must be called after all variables in the EnvVarSet are defined and before variables are accessed by the program.
func (*EnvVarSet) ParseEnviron ¶
ParseEnviron accepts a list of environment variables in the "key=value" format returned by os.Environ(), transforms it into a string map and calls Parse.
func (*EnvVarSet) PrintDefaults ¶ added in v0.5.0
func (s *EnvVarSet) PrintDefaults()
PrintDefaults prints, to standard error unless configured otherwise, the default values of all defined environment variables in the set.
func (*EnvVarSet) QueryString ¶ added in v0.5.0
func (s *EnvVarSet) QueryString(name string, value map[string]string, usage string) *map[string]string
QueryString defines a query string environment variable with specified name, default value, and usage string. The return value is the address of a query string (string map) variable that stores the value of the environment variable.
func (*EnvVarSet) QueryStringVar ¶ added in v0.5.0
func (s *EnvVarSet) QueryStringVar(p *map[string]string, name string, value map[string]string, usage string)
QueryStringVar defines a query string environment variable with specified name, default value, and usage string. The argument p points to a query string (string map) variable in which to store the value of the environment variable.
func (*EnvVarSet) SetNormalizeFunc ¶ added in v0.3.0
func (s *EnvVarSet) SetNormalizeFunc(fn NormalizeFunc)
SetNormalizeFunc allows you to add a function which can translate variable names. Environment variables added to the EnvVarSet will be translated, incoming environment variables will be matched against these translated names.
func (*EnvVarSet) SetOutput ¶ added in v0.2.0
SetOutput sets the destination for usage and error messages. If output is nil, os.Stderr is used.
func (*EnvVarSet) String ¶
String defines a string environment variable with specified name, default value, and usage string. The return value is the address of a string variable that stores the value of the environment variable.
func (*EnvVarSet) StringSlice ¶ added in v0.6.0
StringSlice defines a string environment variable with specified name, default value, and usage string. The return value is the address of a []string variable that stores the value of the environment variable. For example:
STRING_SLICE="v1,v2"
will result in
[]string{"v1", "v2"}
func (*EnvVarSet) StringSliceVar ¶ added in v0.6.0
StringSliceVar defines a string environment variable with specified name, default value, and usage string. The argument p points to a []string variable in which to store the value of the environment variable. For example:
STRING_SLICE="v1,v2"
will result in
[]string{"v1", "v2"}
func (*EnvVarSet) StringVar ¶
StringVar defines a string environment variable with specified name, default value, and usage string. The argument p points to a string variable in which to store the value of the environment variable.
func (*EnvVarSet) Uint ¶
Uint defines a uint environment variable with specified name, default value, and usage string. The return value is the address of a uint variable that stores the value of the environment variable.
func (*EnvVarSet) Uint16 ¶
Uint16 defines a uint16 environment variable with specified name, default value, and usage string. The return value is the address of a uint16 variable that stores the value of the environment variable.
func (*EnvVarSet) Uint16Var ¶
Uint16Var defines a uint16 environment variable with specified name, default value, and usage string. The argument p points to a uint16 variable in which to store the value of the environment variable.
func (*EnvVarSet) Uint32 ¶
Uint32 defines a uint32 environment variable with specified name, default value, and usage string. The return value is the address of a uint32 variable that stores the value of the environment variable.
func (*EnvVarSet) Uint32Var ¶
Uint32Var defines a uint32 environment variable with specified name, default value, and usage string. The argument p points to a uint32 variable in which to store the value of the environment variable.
func (*EnvVarSet) Uint64 ¶
Uint64 defines a uint64 environment variable with specified name, default value, and usage string. The return value is the address of a uint64 variable that stores the value of the environment variable.
func (*EnvVarSet) Uint64Var ¶
Uint64Var defines a uint64 environment variable with specified name, default value, and usage string. The argument p points to a uint64 variable in which to store the value of the environment variable.
func (*EnvVarSet) Uint8 ¶
Uint8 defines a uint8 environment variable with specified name, default value, and usage string. The return value is the address of a uint8 variable that stores the value of the environment variable.
func (*EnvVarSet) Uint8Var ¶
Uint8Var defines a uint8 environment variable with specified name, default value, and usage string. The argument p points to a uint8 variable in which to store the value of the environment variable.
func (*EnvVarSet) UintVar ¶
UintVar defines a uint environment variable with specified name, default value, and usage string. The argument p points to a uint variable in which to store the value of the environment variable.
func (*EnvVarSet) Var ¶
Var defines an environment variable with the specified name and usage string. The type and value of the variable are represented by the first argument, of type Value, which typically holds a user-defined implementation of Value. For instance, the caller could create an environment variable that turns a comma-separated string into a slice of strings by giving the slice the methods of Value; in particular, Set would decompose the comma-separated string into the slice.
type ErrorHandling ¶
type ErrorHandling int
ErrorHandling defines how to handle env var parsing errors.
const ( // ContinueOnError will return an err from Parse() if an error is found ContinueOnError ErrorHandling = iota // ExitOnError will call os.Exit(2) if an error is found ExitOnError // PanicOnError will panic() if an error is found PanicOnError )
type NormalizeFunc ¶ added in v0.3.0
type NormalizeFunc func(s *EnvVarSet, name string) NormalizedName
NormalizeFunc normalizes an environment variable name to the form it can be found in the environment.
type NormalizedName ¶ added in v0.3.0
type NormalizedName string
NormalizedName is an environment variable name that has been normalized according to rules for the EnvVarSet (e.g. making variable names upper case, adding prefixes, etc).
func DefaultNormalizeFunc ¶ added in v0.3.0
func DefaultNormalizeFunc(_ *EnvVarSet, name string) NormalizedName
DefaultNormalizeFunc formats variable names to upper case and replaces "-." chars with "_".
type Value ¶
type Value interface { // Set is responsible for converting the string value to the actual type // and setting it in the target variable. // // When the conversion fails an error should be returned. Set(string) error // Type returns the name of the type the value represents. Type() string // String returns the actual value as string. // // Before any environment parsing happens, the returned value will be the default value. String() string }
Value is the interface to the dynamic value stored in an environment variable. (The default value is represented as a string.)
Source Files ¶
- env.go
- envvar.go
- global.go
- normalization.go
- usage.go
- value.go
- value_bool.go
- value_duration.go
- value_float32.go
- value_float64.go
- value_int.go
- value_int16.go
- value_int32.go
- value_int64.go
- value_int8.go
- value_query_string.go
- value_string.go
- value_string_slice.go
- value_uint.go
- value_uint16.go
- value_uint32.go
- value_uint64.go
- value_uint8.go