Documentation
¶
Overview ¶
Package env is a context-driven wrapper for access to environment variable. It allows substitution of mock environments via context.Context for testing and other purposes.
Index ¶
- func Clearenv(ctx context.Context)
- func Environ(ctx context.Context) []string
- func ExpandEnv(ctx context.Context, s string) string
- func Getenv(ctx context.Context, key string) string
- func LookupEnv(ctx context.Context, key string) (string, bool)
- func Onto(ctx context.Context, env Env) context.Context
- func Setenv(ctx context.Context, key, value string) error
- func Unsetenv(ctx context.Context, key string) error
- type Env
- type Map
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env interface {
Clearenv()
Environ() []string
LookupEnv(key string) (string, bool)
Setenv(key, value string) error
Unsetenv(key string) error
}
Env models the envvar functions of the os package.
Click to show internal directories.
Click to hide internal directories.