Documentation ¶
Overview ¶
Package envconfig provides utilities for reading environment variables.
Index ¶
- type Env
- func (e *Env) Bool(name string, defaultValue bool) bool
- func (e *Env) Duration(name string, defaultValue time.Duration) time.Duration
- func (e *Env) Float64Slice(name string, defaultValue []float64) []float64
- func (e *Env) Int(name string, defaultValue int) int
- func (e *Env) Int64(name string, defaultValue int64) int64
- func (e *Env) String(name string, defaultValue string) string
- func (e *Env) Uint64(name string, defaultValue uint64) uint64
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env holds context for loading config env vars.
func (*Env) Bool ¶
Bool extracts boolean value from env var. It returns the provided defaultValue if the env var is empty. The value returned is also recorded in logs.
func (*Env) Duration ¶
Duration extracts time.Duration value from env var. It returns the provided defaultValue if the env var is empty. The value returned is also recorded in logs.
func (*Env) Float64Slice ¶ added in v1.1.0
Float64Slice extracts []float64 from env var. It returns the provided defaultValue if the env var is empty. The value returned is also recorded in logs.
func (*Env) Int ¶
Int extracts int value from env var. It returns the provided defaultValue if the env var is empty. The value returned is also recorded in logs.
func (*Env) Int64 ¶ added in v1.2.1
Int64 extracts int64 value from env var. It returns the provided defaultValue if the env var is empty. The value returned is also recorded in logs.
type Options ¶
type Options struct { DisableQueryStore bool Secret *secret.Secret Printf boilerplate.FuncPrintf }
Options defines client options.