Documentation
¶
Index ¶
- type Env
- func (e *Env) Changed() []VariableChange
- func (e *Env) Environ() (vars []string)
- func (e *Env) Get(name string) string
- func (e *Env) GetActiveFeatures() map[string]string
- func (e *Env) PrependToPath(path string)
- func (e *Env) RemoveFromPath(substring string)
- func (e *Env) Set(name string, value string)
- func (e *Env) SetFeature(name, param string)
- func (e *Env) Unset(name string)
- func (e *Env) UnsetFeature(name string)
- type VariableChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
An Env provides a simple interface to manipulate environment variables
func NewFromOS ¶
func NewFromOS() (e *Env)
NewFromOS returns a new Env with variables from os.Environ()
func (*Env) Changed ¶
func (e *Env) Changed() []VariableChange
Changed returns all changes made on the variables
func (*Env) GetActiveFeatures ¶
GetActiveFeatures returns a Hash of feature name -> param
func (*Env) PrependToPath ¶
PrependToPath inserts a new path at the beginning of the PATH variable
func (*Env) RemoveFromPath ¶
RemoveFromPath removes all path entries matching a substring
func (*Env) SetFeature ¶
SetFeature marks a feature as active
func (*Env) UnsetFeature ¶
UnsetFeature marks a feature as inactive
type VariableChange ¶
A VariableChange represents the change made on a variable
Click to show internal directories.
Click to hide internal directories.