envconfig

package
v1.300072.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//the following are the names of environment variables
	HTTP_PROXY                  = "HTTP_PROXY"                 //nolint:revive
	HTTPS_PROXY                 = "HTTPS_PROXY"                //nolint:revive
	NO_PROXY                    = "NO_PROXY"                   //nolint:revive
	AWS_CA_BUNDLE               = "AWS_CA_BUNDLE"              //nolint:revive
	AWS_SDK_LOG_LEVEL           = "AWS_SDK_LOG_LEVEL"          //nolint:revive
	AWS_USE_DUALSTACK_ENDPOINT  = "AWS_USE_DUALSTACK_ENDPOINT" //nolint:revive
	CWAGENT_USER_AGENT          = "CWAGENT_USER_AGENT"         //nolint:revive
	CWAGENT_LOG_LEVEL           = "CWAGENT_LOG_LEVEL"          //nolint:revive
	CWAGENT_ROLE                = "CWAGENT_ROLE"               //nolint:revive
	CWAGENT_USAGE_DATA          = "CWAGENT_USAGE_DATA"         //nolint:revive
	IMDS_NUMBER_RETRY           = "IMDS_NUMBER_RETRY"          //nolint:revive
	RunInContainer              = "RUN_IN_CONTAINER"
	RunAsHostProcessContainer   = "RUN_AS_HOST_PROCESS_CONTAINER"
	RunInAWS                    = "RUN_IN_AWS"
	RunInAKS                    = "RUN_IN_AKS"
	RunWithIRSA                 = "RUN_WITH_IRSA"
	RunWithSELinux              = "RUN_WITH_SELINUX"
	RunInROSA                   = "RUN_IN_ROSA"
	UseDefaultConfig            = "USE_DEFAULT_CONFIG"
	HostName                    = "HOST_NAME"
	PodName                     = "POD_NAME"
	HostIP                      = "HOST_IP"
	CWConfigContent             = "CW_CONFIG_CONTENT"
	CWOtelConfigContent         = "CW_OTEL_CONFIG_CONTENT"
	CWAgentMergedOtelConfig     = "CWAGENT_MERGED_OTEL_CONFIG"
	CWAgentLogsBackpressureMode = "CWAGENT_LOGS_BACKPRESSURE_MODE"
	SystemMetricsEnabled        = "SYSTEM_METRICS_ENABLED"
	OtelCIVersion               = "OTEL_CI_VERSION"

	// confused deputy prevention related headers
	AmzSourceAccount = "AMZ_SOURCE_ACCOUNT" // populates the "x-amz-source-account" header
	AmzSourceArn     = "AMZ_SOURCE_ARN"     // populates the "x-amz-source-arn" header
)
View Source
const (
	TrueValue = "True"   // TrueValue is the expected string set on an environment variable to indicate true.
	LEADER    = "LEADER" //nolint:revive
	NODE      = "NODE"   //nolint:revive
)

Variables

This section is empty.

Functions

func GetLogsBackpressureMode added in v1.300054.0

func GetLogsBackpressureMode() string

func IsRunningInAKS added in v1.300071.0

func IsRunningInAKS() bool

IsRunningInAKS reports whether RUN_IN_AKS is set (by the AKS Helm chart) so AKS is detected without a metadata probe.

func IsRunningInContainer added in v1.300030.1

func IsRunningInContainer() bool

func IsRunningInROSA added in v1.300054.0

func IsRunningInROSA() bool

func IsSelinuxEnabled added in v1.300054.0

func IsSelinuxEnabled() bool

func IsUsageDataEnabled added in v1.300030.1

func IsUsageDataEnabled() bool

func IsWindowsHostProcessContainer added in v1.300035.0

func IsWindowsHostProcessContainer() bool

func LoadFile added in v1.300071.0

func LoadFile(path string) error

LoadFile loads environment variables from the given env-config.json into the process environment, logging each variable set and any that fail to set.

func MergeFile added in v1.300071.0

func MergeFile(path string, values map[string]string, keysToRemove ...string) error

MergeFile merges values into the env-config.json at path. Existing keys are retained unless listed in keysToRemove. A missing file is treated as empty. Other read errors leave the file untouched.

func ReadFile added in v1.300071.0

func ReadFile(path string) (map[string]string, error)

ReadFile parses the env-config.json at the given path and returns the key-value pairs. Returns an error if the file is missing or cannot be parsed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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