env

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(c cookoo.Context, params *cookoo.Params) (interface{}, cookoo.Interrupt)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL