Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envr ¶
type Envr struct {
Ready bool `json:"ready"` // Flag for the goodness
Name string `json:"environmentName"` // name of environment
Files []string `json:"configFiles"` // files to read from, default .env
RequiredVars []string `json:"requiredVars"` // the env vars we need
ExistingVars []string `json:"existingVars"` // the env vars that are set
MissingVars []string `json:"missingVars"` // the env vars not set
V map[string]string `json:"values"` // map of existing vars and values
Status string `json:"status"` // a message about current statuss
Error error `json:"error"` // error field, for easier method chaining
}
Envr contains info about the environment setup
func New ¶
New sets up a new Environment. It takes an arbitrary name (n), a list of required vars (vs) and zero or more file names from which to read the vars, eg ".env1,.env2". Defaults to .env
func (*Envr) Auto ¶
Auto does Clean().Fatal() so will force the setting of all the required vars from the config, and die if things didn't workout
func (*Envr) Fatal ¶
Fatal is chained on so we can log fatal in the event our environment is not set up properly
func (*Envr) SetList ¶
SetList just sets a list of env vars passed in to 'lv'. Also need to pass in the config vars map 'ev' so we can check there is a value there before we try to set it.
Click to show internal directories.
Click to hide internal directories.