Documentation
¶
Overview ¶
Package internal provides internal implementation logic for environment variables parsing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotSet is an error that is returned when the environment variable is not set. ErrNotSet = errors.New("not set") // ErrInvalidValue is an error that is returned when the environment variable is not valid. ErrInvalidValue = errors.New("invalid value") )
Functions ¶
This section is empty.
Types ¶
type Complex ¶ added in v1.9.0
type Complex = constraints.Complex
Complex is a constraint for complex and slice of complex.
type ComplexSlice ¶ added in v1.11.0
type ComplexSlice interface {
[]complex64 | []complex128
}
ComplexSlice is a constraint for slice of complex.
type EnvParsable ¶
type EnvParsable interface {
String | Number | NumberSlice | Time | Bool | URL | IP | Complex | ComplexSlice
}
EnvParsable is a constraint for types that can be parsed from environment variable.
type EnvParser ¶
type EnvParser interface {
// ParseEnv parses environment variable by key and returns value.
ParseEnv(key string, options Parameters) (any, error)
}
EnvParser interface for parsing environment variables.
type FloatSlice ¶ added in v1.11.0
FloatSlice is a constraint for slice of floats.
type NumberSlice ¶ added in v1.11.0
type NumberSlice interface {
IntSlice | FloatSlice | UintSlice
}
NumberSlice is a constraint for slice of integers, floats and unsigned integers.
type Parameters ¶
Parameters is a struct for holding parameters for the parser. It is used to pass parameters to the parser. Separator is a separator for the environment variable that holds slice. Layout is a layout for the time.Time.
type Uint ¶ added in v1.6.0
type Uint = constraints.Unsigned
Uint is a constraint for unsigned integer and slice of unsigned integers.