Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get gets one or more environment variables and puts them into the context.
Parameters passed in are of the form varname => defaultValue.
r.Route("foo", "example").Does(envvar.Get).Using("HOME").WithDefault(".")
As with all environment variables, the default value must be a string.
WARNING: Since parameters are a map, order of processing is not guaranteed. If order is important, you'll need to call this command multiple times.
For each parameter (`Using` clause), this command will look into the environment for a matching variable. If it finds one, it will add that variable to the context. If it does not find one, it will expand the default value (so you can set a default to something like "$HOST:$PORT") and also put the (unexpanded) default value back into the context in case any subsequent call to `os.Getenv` occurs.
Types ¶
This section is empty.