Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Envars ¶
Envars is a convenience alias
func (Envars) Apply ¶
Apply ops to these Envars and return the resulting Transform.
Envars are not modified.
type Force ¶
Force set/unset an environment variable without preserving or restoring its previous value.
type Op ¶
type Op interface { fmt.Stringer Envar() string // Apply changes to transform. // // This may also add/remove extra housekeeping variables to support Revert. Apply(transform *Transform) // Revert the changes made by Apply. Revert(transform *Transform) // contains filtered or unexported methods }
Op is an operation on an environment variable.
type Ops ¶
type Ops []Op
Ops to apply to a set of environment variables.
func Infer ¶
Infer uses simple heuristics to build a sequence of transformations for environment variables.
Currently this consists of detecting prepend/append to :-separated lists, set and unset.
func UnmarshalOps ¶ added in v0.15.2
UnmarshalOps from JSON.
type Transform ¶
type Transform struct {
// contains filtered or unexported fields
}
Transform encapsulates low-level transformations on an existing environment.
func (*Transform) Changed ¶
Changed returns the set of changed Envars.
If "undo" is true the returned Envars will include undo state.