env

package
v0.0.0-...-0a43815 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BySource

type BySource struct {
	Explicit EnvironmentVariableMap
	Matching EnvironmentVariableMap
}

BySource contains a map of environment variables broken down by the source

type DetailedMap

type DetailedMap struct {
	All      EnvironmentVariableMap
	BySource BySource
}

DetailedMap contains the composite and the detailed maps of environment variables All is used as a taskhash input (taskhash.CalculateTaskHash) BySource is used to print out a Dry Run Summary

type EnvironmentVariableMap

type EnvironmentVariableMap map[string]string

EnvironmentVariableMap is a map of env variables and their values

func GetEnvMap

func GetEnvMap() EnvironmentVariableMap

GetEnvMap returns a map of env vars and their values from os.Environ

func (EnvironmentVariableMap) Add

func (evm EnvironmentVariableMap) Add(key string, value string)

Add creates one new environment variable.

func (EnvironmentVariableMap) Difference

func (evm EnvironmentVariableMap) Difference(another EnvironmentVariableMap)

Difference takes another EnvironmentVariableMap and removes matching keys from the receiver

func (EnvironmentVariableMap) FromWildcards

func (evm EnvironmentVariableMap) FromWildcards(wildcardPatterns []string) (EnvironmentVariableMap, error)

FromWildcards returns an EnvironmentVariableMap containing the variables in the environment which match an array of wildcard patterns.

func (EnvironmentVariableMap) FromWildcardsUnresolved

func (evm EnvironmentVariableMap) FromWildcardsUnresolved(wildcardPatterns []string) (WildcardMaps, error)

FromWildcardsUnresolved returns a wildcardSet specifying the inclusions and exclusions discovered from a set of wildcard patterns. This is used to ensure that user exclusions have primacy over inferred inclusions.

func (EnvironmentVariableMap) Names

func (evm EnvironmentVariableMap) Names() []string

Names returns a sorted list of env var names for the EnvironmentVariableMap

func (EnvironmentVariableMap) ToHashable

ToHashable returns a deterministically sorted set of EnvironmentVariablePairs from an EnvironmentVariableMap This is the value that is used upstream as a task hash input, so we need it to be deterministic

func (EnvironmentVariableMap) ToSecretHashable

func (evm EnvironmentVariableMap) ToSecretHashable() EnvironmentVariablePairs

ToSecretHashable returns a deterministically sorted set of EnvironmentVariablePairs from an EnvironmentVariableMap This is the value used to print out the task hash input, so the values are cryptographically hashed

func (EnvironmentVariableMap) Union

Union takes another EnvironmentVariableMap and adds it into the receiver It overwrites values if they already exist.

type EnvironmentVariablePairs

type EnvironmentVariablePairs []string

EnvironmentVariablePairs is a list of "k=v" strings for env variables and their values

type WildcardMaps

type WildcardMaps struct {
	Inclusions EnvironmentVariableMap
	Exclusions EnvironmentVariableMap
}

WildcardMaps is a pair of EnvironmentVariableMaps.

func (WildcardMaps) Resolve

func (ws WildcardMaps) Resolve() EnvironmentVariableMap

Resolve collapses a WildcardSet into a single EnvironmentVariableMap.

Jump to

Keyboard shortcuts

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