Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ReportWriter io.Writer = os.Stdout
Functions ¶
func Load ¶
func Load(t interface{}) error
Load will use the `env` tags from a struct to populate the structs values and perform validations.
func ToEnv ¶ added in v1.2.0
func ToEnv(t interface{}) []string
ToEnv will return a slice of strings that can be used with exec.Cmd.Env formatted as `ENVAR_NAME=value` for a given struct.
func WriteReport ¶
func WriteReport(t interface{}) error
WriteReport will take a struct that is setup for envstruct and print out a report containing the struct field name, field type, environment variable for that field, whether or not the field is required and the value of that field. The report is written to `ReportWriter` which defaults to `os.StdOut`. Sensetive values that you would not want appearing in logs can be omitted with the `noreport` value in the `env` struct tag.
Types ¶
type Unmarshaller ¶
Unmarshaller is a type which unmarshals itself from an environment variable.