env

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env interface {
	Getenv(key string) string
	Setenv(key, value string) error
	LookupEnv(key string) (string, bool)
	Environ() []string
}

Env interface allows us to substitute the system environment with other targets. See os package for definition of functions.

type EnvMap

type EnvMap struct {
	Vars map[string]string
}

EnvMap gets vars from a map

func (*EnvMap) Environ

func (s *EnvMap) Environ() []string

func (*EnvMap) Getenv

func (s *EnvMap) Getenv(key string) string

func (*EnvMap) LookupEnv

func (s *EnvMap) LookupEnv(key string) (string, bool)

func (*EnvMap) Setenv

func (s *EnvMap) Setenv(key, value string) error

type EnvOS

type EnvOS struct{}

EnvOS gets vars from system

func (*EnvOS) Environ

func (s *EnvOS) Environ() []string

func (*EnvOS) Getenv

func (s *EnvOS) Getenv(key string) string

func (*EnvOS) LookupEnv

func (s *EnvOS) LookupEnv(key string) (string, bool)

func (*EnvOS) Setenv

func (s *EnvOS) Setenv(key, value string) error

Jump to

Keyboard shortcuts

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