env

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PrefixDelimiter is used to separate prefix from value in environment variables
	PrefixDelimiter = ":"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HostResolver

type HostResolver struct {
	// contains filtered or unexported fields
}

HostResolver handles host environment variable references

func NewHostResolver

func NewHostResolver(allowList []string) *HostResolver

func (*HostResolver) Prefix

func (h *HostResolver) Prefix() string

func (*HostResolver) Validate

func (h *HostResolver) Validate(name string, value string) error

Validate checks if the value is allowed

func (*HostResolver) Value

func (h *HostResolver) Value(value string) (string, error)

Value returns the value from host environment

type ResolverMap

type ResolverMap struct {
	// contains filtered or unexported fields
}

ResolverMap handles delegation to specific environment variable resolvers

func NewResolver

func NewResolver(params ResolverParams) *ResolverMap

NewResolver creates a new resolver map with configured resolvers

func (*ResolverMap) Validate

func (m *ResolverMap) Validate(name string, value string) error

Validate checks if any resolver can handle this value

func (*ResolverMap) Value

func (m *ResolverMap) Value(value string) (string, error)

GetValue resolves a value using the appropriate resolver

type ResolverParams

type ResolverParams struct {
	// AllowList specifies which host environment variables can be forwarded to jobs.
	// Supports glob patterns (e.g., "AWS_*", "API_*")
	AllowList []string
}

ResolverParams contains configuration for environment variable resolvers

Jump to

Keyboard shortcuts

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