Documentation ¶
Index ¶
- func Get[T Type](key string, def T) T
- func GetBool(key string, def bool) bool
- func GetFloat32(key string, def float32) float32
- func GetFloat32Slice(key string, def []float32) []float32
- func GetFloat64(key string, def float64) float64
- func GetFloat64Slice(key string, def []float64) []float64
- func GetInt(key string, def int) int
- func GetInt16(key string, def int16) int16
- func GetInt16Slice(key string, def []int16) []int16
- func GetInt32(key string, def int32) int32
- func GetInt32Slice(key string, def []int32) []int32
- func GetInt64(key string, def int64) int64
- func GetInt64Slice(key string, def []int64) []int64
- func GetInt8(key string, def int8) int8
- func GetInt8Slice(key string, def []int8) []int8
- func GetIntSlice(key string, def []int) []int
- func GetString(key, def string) string
- func GetStringSlice(key string, def []string) []string
- func GetUint(key string, def uint) uint
- func GetUint16(key string, def uint16) uint16
- func GetUint16Slice(key string, def []uint16) []uint16
- func GetUint32(key string, def uint32) uint32
- func GetUint32Slice(key string, def []uint32) []uint32
- func GetUint64(key string, def uint64) uint64
- func GetUint64Slice(key string, def []uint64) []uint64
- func GetUint8(key string, def uint8) uint8
- func GetUint8Slice(key string, def []uint8) []uint8
- func GetUintSlice(key string, def []uint) []uint
- func Is(e1 Env, ee ...Env) bool
- func IsDevelopment() bool
- func IsProduction() bool
- func IsStaging() bool
- func IsTesting() bool
- func MustGet[T Type](key string) T
- func MustGetBool(key string) bool
- func MustGetFloat32(key string) float32
- func MustGetFloat32Slice(key string) []float32
- func MustGetFloat64(key string) float64
- func MustGetFloat64Slice(key string) []float64
- func MustGetInt(key string) int
- func MustGetInt16(key string) int16
- func MustGetInt16Slice(key string) []int16
- func MustGetInt32(key string) int32
- func MustGetInt32Slice(key string) []int32
- func MustGetInt64(key string) int64
- func MustGetInt64Slice(key string) []int64
- func MustGetInt8(key string) int8
- func MustGetInt8Slice(key string) []int8
- func MustGetIntSlice(key string) []int
- func MustGetString(key string) string
- func MustGetStringSlice(key string) []string
- func MustGetUint(key string) uint
- func MustGetUint16(key string) uint16
- func MustGetUint16Slice(key string) []uint16
- func MustGetUint32(key string) uint32
- func MustGetUint32Slice(key string) []uint32
- func MustGetUint64(key string) uint64
- func MustGetUint64Slice(key string) []uint64
- func MustGetUint8(key string) uint8
- func MustGetUint8Slice(key string) []uint8
- func MustGetUintSlice(key string) []uint
- type Env
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶ added in v1.6.0
Get extracts value from env based on its type. if not set, returns default value.
func GetFloat32 ¶ added in v1.1.0
GetFloat32 extracts int value from env, if not set, returns default value.
func GetFloat32Slice ¶ added in v1.5.0
GetFloat32Slice extracts slice of float32 value with the format "1.2,2.3,3.4" from env. if not set, returns default value.
func GetFloat64 ¶ added in v1.1.0
GetFloat64 extracts int value from env. if not set, returns default value.
func GetFloat64Slice ¶ added in v1.5.0
GetFloat64Slice extracts slice of float64 value with the format "1.2,2.3,3.4" from env. if not set, returns default value.
func GetInt16 ¶ added in v1.1.0
GetInt16 extracts int16 value from env. if not set, returns default value.
func GetInt16Slice ¶ added in v1.4.0
GetInt16Slice extracts slice of int16 value with the format "1,2,3" from env. if not set, returns default value.
func GetInt32 ¶ added in v1.1.0
GetInt32 extracts int32 value from env. if not set, returns default value.
func GetInt32Slice ¶ added in v1.4.0
GetInt32Slice extracts slice of int32 value with the format "1,2,3" from env. if not set, returns default value.
func GetInt64 ¶ added in v1.1.0
GetInt64 extracts int64 value from env. if not set, returns default value.
func GetInt64Slice ¶ added in v1.4.0
GetInt64Slice extracts slice of int64 value with the format "1,2,3" from env. if not set, returns default value.
func GetInt8 ¶ added in v1.1.0
GetInt8 extracts int8 value from env. if not set, returns default value.
func GetInt8Slice ¶ added in v1.4.0
GetInt8Slice extracts slice of int8 value with the format "1,2,3" from env. if not set, returns default value.
func GetIntSlice ¶ added in v1.4.0
GetIntSlice extracts slice of int value with the format "1,2,3" from env. if not set, returns default value.
func GetStringSlice ¶ added in v1.2.0
GetStringSlice extracts slice of strings value with format "foo,bar,baz" from env. if not set, returns default value.
func GetUint ¶ added in v1.4.0
GetUint extracts uint value from env. if not set, returns default value.
func GetUint16 ¶ added in v1.4.0
GetUint16 extracts uint16 value from env. if not set, returns default value.
func GetUint16Slice ¶ added in v1.4.0
GetUint16Slice extracts slice of uint16 value with the format "1,2,3" from env. if not set, returns default value.
func GetUint32 ¶ added in v1.4.0
GetUint32 extracts uint32 value from env. if not set, returns default value.
func GetUint32Slice ¶ added in v1.4.0
GetUint32Slice extracts slice of uint32 value with the format "1,2,3" from env. if not set, returns default value.
func GetUint64 ¶ added in v1.4.0
GetUint64 extracts uint64 value from env. if not set, returns default value.
func GetUint64Slice ¶ added in v1.4.0
GetUint64Slice extracts slice of uint64 value with the format "1,2,3" from env. if not set, returns default value.
func GetUint8 ¶ added in v1.4.0
GetUint8 extracts uint8 value from env. if not set, returns default value.
func GetUint8Slice ¶ added in v1.4.0
GetUint8Slice extracts slice of uint8 value with the format "1,2,3" from env. if not set, returns default value.
func GetUintSlice ¶ added in v1.4.0
GetUintSlice extracts slice of uint value with the format "1,2,3" from env. if not set, returns default value.
func IsDevelopment ¶
func IsDevelopment() bool
IsDevelopment checks whether ENV is development or not.
func MustGet ¶ added in v1.6.0
MustGet extracts string value from env based on its type. if not set, it panics.
func MustGetBool ¶
MustGetBool extracts bool value from env. if not set, it panics.
func MustGetFloat32 ¶ added in v1.1.0
MustGetFloat32 extracts int value from env. if not set, it panics.
func MustGetFloat32Slice ¶ added in v1.5.0
MustGetFloat32Slice extracts slice of float32 value with the format "1.2,2.3,3.4" from env. if not set, it panics.
func MustGetFloat64 ¶ added in v1.1.0
MustGetFloat64 extracts int value from env. if not set, it panics.
func MustGetFloat64Slice ¶ added in v1.5.0
MustGetFloat64Slice extracts slice of float64 value with the format "1.2,2.3,3.4" from env. if not set, it panics.
func MustGetInt ¶
MustGetInt extracts int value from env. if not set, it panics.
func MustGetInt16 ¶ added in v1.1.0
MustGetInt16 extracts int16 value from env. if not set, it panics.
func MustGetInt16Slice ¶ added in v1.4.0
MustGetInt16Slice extracts slice of int16 value with the format "1,2,3" from env. if not set, it panics.
func MustGetInt32 ¶ added in v1.1.0
MustGetInt32 extracts int32 value from env. if not set, it panics.
func MustGetInt32Slice ¶ added in v1.4.0
MustGetInt32Slice extracts slice of int32 value with the format "1,2,3" from env. if not set, it panics.
func MustGetInt64 ¶ added in v1.1.0
MustGetInt64 extracts int64 value from env. if not set, it panics.
func MustGetInt64Slice ¶ added in v1.4.0
MustGetInt64Slice extracts slice of int64 value with the format "1,2,3" from env. if not set, it panics.
func MustGetInt8 ¶ added in v1.1.0
MustGetInt8 extracts int8 value from env. if not set, it panics.
func MustGetInt8Slice ¶ added in v1.4.0
MustGetInt8Slice extracts slice of int8 value with the format "1,2,3" from env. if not set, it panics.
func MustGetIntSlice ¶ added in v1.4.0
MustGetIntSlice extracts slice of int value with the format "1,2,3" from env. if not set, it panics.
func MustGetString ¶
MustGetString extracts string value from env. if not set, it panics.
func MustGetStringSlice ¶ added in v1.2.0
MustGetStringSlice extracts slice of strings value with format "foo,bar,baz" from env. if not set, it panics.
func MustGetUint ¶ added in v1.4.0
MustGetUint extracts uint value from env. if not set, it panics.
func MustGetUint16 ¶ added in v1.4.0
MustGetUint16 extracts uint16 value from env. if not set, it panics.
func MustGetUint16Slice ¶ added in v1.4.0
MustGetUint16Slice extracts slice of uint16 value with the format "1,2,3" from env. if not set, it panics.
func MustGetUint32 ¶ added in v1.4.0
MustGetUint32 extracts uint32 value from env. if not set, it panics.
func MustGetUint32Slice ¶ added in v1.4.0
MustGetUint32Slice extracts slice of uint32 value with the format "1,2,3" from env. if not set, it panics.
func MustGetUint64 ¶ added in v1.4.0
MustGetUint64 extracts uint64 value from env. if not set, it panics.
func MustGetUint64Slice ¶ added in v1.4.0
MustGetUint64Slice extracts slice of uint64 value with the format "1,2,3" from env. if not set, it panics.
func MustGetUint8 ¶ added in v1.4.0
MustGetUint8 extracts uint8 value from env. if not set, it panics.
func MustGetUint8Slice ¶ added in v1.4.0
MustGetUint8Slice extracts slice of uint8 value with the format "1,2,3" from env. if not set, it panics.
func MustGetUintSlice ¶ added in v1.4.0
MustGetUintSlice extracts slice of uint value with the format "1,2,3" from env. if not set, it panics.
Types ¶
Source Files ¶
- bool.go
- env.go
- float32.go
- float32_slice.go
- float64.go
- float64_slice.go
- generic.go
- int.go
- int16.go
- int16_slice.go
- int32.go
- int32_slice.go
- int64.go
- int64_slice.go
- int8.go
- int8_slice.go
- int_slice.go
- string.go
- string_slice.go
- uint.go
- uint16.go
- uint16_slice.go
- uint32.go
- uint32_slice.go
- uint64.go
- uint64_slice.go
- uint8.go
- uint8_slice.go
- uint_slice.go