Documentation
¶
Overview ¶
Package envcompat keeps the pre-rename LEOFLOW_* environment variables and their DEXAFLOW_* names interchangeable.
Every binary calls Mirror before reading its configuration. Afterwards both spellings of every variable hold the same value, so code (and older agents, task images and scripts) that reads LEOFLOW_* and documentation that says DEXAFLOW_* agree. Child processes inherit the mirrored environment.
Index ¶
Constants ¶
const LegacyPrefix = "LEOFLOW_"
LegacyPrefix is the prefix before the rename. It keeps working.
const NewPrefix = "DEXAFLOW_"
NewPrefix is the environment variable prefix since the Dexaflow rename.
Variables ¶
This section is empty.
Functions ¶
func Lookup ¶ added in v0.5.4
Lookup returns the value of the variable named NewPrefix+suffix, else of LegacyPrefix+suffix, and whether either holds a non-empty value. It reads the process environment directly, so it agrees with Mirror without depending on the binary having called it: a CLI command run from a test, or embedded in another program, sees the same answer.
Types ¶
type Report ¶
type Report struct {
// Legacy holds the variables set only under their LEOFLOW_* name.
Legacy []string
// Conflicts holds the variables set under both names with different values.
Conflicts []string
// Failed holds the variables Mirror could not write, with the reason.
Failed []string
}
Report lists what Mirror found, by legacy variable name.
func Mirror ¶
Mirror makes every NewPrefix variable and its LegacyPrefix counterpart hold the same value, writing through set. When both are present and differ, the NewPrefix value wins.
func MirrorProcess ¶
func MirrorProcess() Report
MirrorProcess applies Mirror to the current process environment.
func (Report) ConflictNotes ¶
ConflictNotes renders one line per conflicting pair.