env

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, env Env) context.Context

NewContext creates a new context with the given env

Types

type Env

type Env map[string]string

Env represents a key/value mapping of environment variables

func FromContext

func FromContext(ctx context.Context) (Env, error)

FromContext returns the environment from a context

func (Env) AddFromHTTPRequest

func (env Env) AddFromHTTPRequest(r *http.Request)

AddFromHTTPRequest adds environment variables from an HTTP request

func (Env) Copy

func (env Env) Copy() Env

Copy returns a copy of the current environment

func (Env) ReadOSEnvironment

func (env Env) ReadOSEnvironment() error

ReadOSEnvironment parses the operating systems environment variables

func (Env) ToSlice

func (env Env) ToSlice() []string

ToSlice returns a env slice usable in exec.Cmd

Jump to

Keyboard shortcuts

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