Documentation
¶
Overview ¶
Package envir reads environment variables.
Index ¶
- Variables
- func Bool(name string, defaultValue bool) bool
- func BoolValue(name string) bool
- func Duration(name string, defaultValue time.Duration) time.Duration
- func Float64(name string, defaultValue float64) float64
- func Int(name string, defaultValue int) int
- func Int64(name string, defaultValue int64) int64
- func IntValue(name string) int
- func IsPresent(name string) bool
- func IsSet(name string) bool
- func MustBool(name string) bool
- func MustDuration(name string) time.Duration
- func MustFloat64(name string) float64
- func MustInt(name string) int
- func MustInt64(name string) int64
- func MustString(name string) string
- func MustUint(name string) uint
- func MustUint64(name string) uint64
- func New(options ...func(oinment *oinment)) *oinment
- func NewLookupComposition(primary lookupInterface, opts ...func(*lookupComposition)) *lookupComposition
- func NewLookupFile(path string, opts ...func(*lookupFile)) *lookupFile
- func NewLookupOs() wrapOs
- func String(name, defaultValue string) string
- func StringValue(name string) string
- func Uint(name string, defaultValue uint) uint
- func Uint64(name string, defaultValue uint64) uint64
- func UintValue(name string) uint
- func Value(name string) string
- func WithCutPrefix(cutPrefix string) func(*lookupFile)
- func WithDecoder(decoder decoderInterface) func(*lookupFile)
- func WithEnvSubst() func(*oinment)
- func WithLookup(lookuper lookupInterface) func(*oinment)
- func WithMustDecode() func(*lookupFile)
- func WithOptional(optionals ...lookupInterface) func(*lookupComposition)
- func WithPrefix(prefix string) func(*oinment)
Constants ¶
This section is empty.
Variables ¶
var ( DefaultLookup = NewLookupOs() DefaultExpander = asisExpander{} )
var DefaultDecoder = decoders.NewEnv()
Functions ¶
func BoolValue ¶
BoolValue treats env string as boolean: 1, yes, Y, true, etc are true, exceptions are false. DEPRECATED: use MustBool instead.
func IntValue ¶
IntValue returns env variable as integer, panics in case of error. DEPRECATED: use MustInt.
func MustDuration ¶
MustDuration returns value or panics if there is no variable present.
func MustFloat64 ¶
MustFloat64 returns value or panics if there is no variable present.
func MustString ¶
MustString returns value or panics if there is no variable present.
func MustUint64 ¶
MustUint64 returns value or panics if there is no variable present.
func NewLookupComposition ¶
func NewLookupComposition(primary lookupInterface, opts ...func(*lookupComposition)) *lookupComposition
func NewLookupFile ¶
func NewLookupFile(path string, opts ...func(*lookupFile)) *lookupFile
func NewLookupOs ¶
func NewLookupOs() wrapOs
func StringValue ¶
StringValue returns env variable as string, panics in case of error. DEPRECATED: use MustString instead.
func UintValue ¶
UintValue returns env variable as integer, panics in case of error. DEPRECATED: use MustUint.
func WithCutPrefix ¶
func WithCutPrefix(cutPrefix string) func(*lookupFile)
func WithDecoder ¶
func WithDecoder(decoder decoderInterface) func(*lookupFile)
func WithEnvSubst ¶
func WithEnvSubst() func(*oinment)
func WithLookup ¶
func WithLookup(lookuper lookupInterface) func(*oinment)
func WithMustDecode ¶
func WithMustDecode() func(*lookupFile)
func WithOptional ¶
func WithOptional(optionals ...lookupInterface) func(*lookupComposition)
func WithPrefix ¶
func WithPrefix(prefix string) func(*oinment)
Types ¶
This section is empty.