envhelper

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 14

Documentation

Index

Constants

View Source
const (
	EnvKeyPodName      = "POD_NAME"
	EnvKeyPodNamespace = "POD_NAMESPACE"
)

Kubernetes pod identification

Variables

This section is empty.

Functions

func EnvListToMap added in v0.6.0

func EnvListToMap(envList []string) map[string]string

func Expand

func Expand(s string, mapping func(varName, origin string) string) string

Expand replaces ${var}, $(var) or $var in the string based on the mapping function.

func ThisPodNS

func ThisPodNS() string

func ThisPodName

func ThisPodName() string

Types

type EnvRenderingHandler added in v0.6.0

type EnvRenderingHandler struct {
	// Env used for expansion
	// Required if you do want to expand some env
	Env map[string]string

	AllowNotFound bool
}

EnvRenderingHandler expands rawData with environment variables with bash string replacement functions support Please refer to https://github.com/drone/envsubst

func (*EnvRenderingHandler) RenderYaml added in v0.6.0

func (h *EnvRenderingHandler) RenderYaml(
	_ string, rawData interface{},
) (interface{}, error)

Jump to

Keyboard shortcuts

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