env

package
Version: v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Defined

func Defined(keys ...string) bool

Helper method for quickly check if envs are present

func Getenv

func Getenv(key string) string

Helper method for quickly accessing environment variables

func WithStubbedEnv

func WithStubbedEnv(stubs Stubs, block func())

Used mostly in tests, allows you to stub environment for testing

Types

type Env

type Env interface {
	Getenv(key string) string
	LookupEnv(key string) (string, bool)
}

Env interface describes env objects used for environment variables lookup

func New

func New() Env

Create a new environment accessor

type Stubs

type Stubs map[string]string

Stubs that allow you to define key -> value of an environment variable

Source Files

Jump to

Keyboard shortcuts

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