Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AutoPanic = true
View Source
var AutoPath = ".env"
View Source
var AutoVerbose = true
Functions ¶
func Auto ¶
func Auto(e interface{})
Auto reads an struct of enironment variables from any of the following:
- Attempt to read env variables from the system.
- If the above fails, fall back to reading env from file. See AutoPath
If this function fails, it will panic if AutoPanic is set to true.
See AutoPanic
func Properties ¶
Properties loads an environment file and returns it as a map[string]string. This is the best option for a lightweight env reader.
func UnmarshalFromFile ¶ added in v0.1.12
UnmarshalFromFile attempts to read a struct from an existing env file. It will ignore any values not annotated as `envie="VAR_NAME"`. It returns an error if it fails.
func UnmarshalFromSystem ¶ added in v0.1.12
func UnmarshalFromSystem(e interface{}) error
UnmarshalFromSystem reads an entire struct of env variables. Returns an error if any of those variables does not exist in the environment.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.