mgenv

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(name string, other bool, doc string) bool

Bool registers an environment variable and interprets the current variable as bool.

func Keys

func Keys() []string

Keys returns the keys of registered environment variables. The keys returned are sorted. Note: The returned slice must not be changed or appended to.

func MakeEnv

func MakeEnv() map[string]string

MakeEnv builds a dictionary of defined environment variables, such that these can be passed to other processes (e.g. providers)

func String

func String(name, other, doc string) string

String registers an environment variable and reads the current contents.

Types

type Var

type Var struct {
	// contains filtered or unexported fields
}

Var holds an environment variables name, default value and doc string.

func Find

func Find(name string) (Var, bool)

Find returns a registered Var by name.

func (Var) Default

func (v Var) Default() string

Default returns the environment variables default value as string.

func (Var) Doc

func (v Var) Doc() string

Doc returns the doc-string.

func (Var) Get

func (v Var) Get() string

Get reads an environment variable. Get returns the default value if the variable is not present or empty.

func (Var) Name

func (v Var) Name() string

Name returns the environment variables name

Jump to

Keyboard shortcuts

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