Discover Packages
github.com/cashapp/hermit
envars
package
Version:
v0.2.19
Opens a new window with list of versions in this module.
Published: Aug 27, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation Source Files Index Constants Variables Functions Types type Append type Envars type Force type Op type Ops type Prefix type Prepend type Set type Transform type Unset (e) Apply(transform) (e) Envar() (e) Revert(transform) (e) String() Parse(envars) (e) Apply(envRoot, ops) (e) Clone() (e) Revert(envRoot, ops) (e) System() (f) Apply(transform) (f) Envar() (f) Revert(transform) (f) String() Infer(env) (p) Apply(transform) (p) Envar() (p) Revert(transform) (p) String() (e) Apply(transform) (e) Envar() (e) Revert(transform) (e) String() (e) Apply(transform) (e) Envar() (e) Revert(transform) (e) String() (t) Changed(undo) (t) Combined() (t) To(env) (e) Apply(transform) (e) Envar() (e) Revert(transform) (e) String()
Documentation
¶
Append ensures an element exists at the end of a colon separated list.
Envars is a convenience alias
Parse a KEY=VALUE list of environment variables into an Envars map.
Apply ops to these Envars and return the resulting Transform.
Envars are not modified.
Revert creates a Transform that reverts the application of the provided Ops.
Envars are not modified.
System renders the Envars in the format expected by the system, ie. KEY=VALUE
Force set/unset an environment variable without preserving or restoring its previous value.
Op is an operation on an environment variable.
Ops to apply to a set of environment variables.
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.
Prefix ensures the environment variable has the given prefix.
Prepend ensures an element exists at the beginning of a colon separated list.
Set an environment variable.
type Transform struct {
}
Transform encapsulates low-level transformations on an existing environment.
Changed returns the set of changed Envars.
If "undo" is true the returned Envars will include undo state.
Combined returns a copy of the full set of original Envars with Changed applied.
Deleted keys will be removed.
To applies the Transform to "env" in place.
type Unset struct {
Name string
}
Unset an environment variable.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.