env

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Instance = &Env{}

Functions

func Default added in v0.0.25

func Default(key string, value string) func()

Default will set a default key/value inside the environment only if value is empty string. It returns a function you can optionally later call to set the environment back to the original, unset value.

Types

type Env

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

func New

func New(getEnv func(string) string, environ func() []string) *Env

func NewFromMap added in v0.0.67

func NewFromMap(e map[string]string) *Env

func (*Env) AddEnv

func (e *Env) AddEnv(env ...string) []string

func (*Env) Get

func (e *Env) Get(env string) string

func (*Env) GetDefault

func (e *Env) GetDefault(env string, def string) string

Jump to

Keyboard shortcuts

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