envprovider

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package envprovider provides utilities for accessing environment variables to pass Mountpoint.

Index

Constants

View Source
const (
	EnvRegion                = "AWS_REGION"
	EnvDefaultRegion         = "AWS_DEFAULT_REGION"
	EnvSTSRegionalEndpoints  = "AWS_STS_REGIONAL_ENDPOINTS"
	EnvMaxAttempts           = "AWS_MAX_ATTEMPTS"
	EnvProfile               = "AWS_PROFILE"
	EnvConfigFile            = "AWS_CONFIG_FILE"
	EnvSharedCredentialsFile = "AWS_SHARED_CREDENTIALS_FILE"
	EnvRoleARN               = "AWS_ROLE_ARN"
	EnvWebIdentityTokenFile  = "AWS_WEB_IDENTITY_TOKEN_FILE"
	EnvEC2MetadataDisabled   = "AWS_EC2_METADATA_DISABLED"
	EnvAccessKeyID           = "AWS_ACCESS_KEY_ID"
	EnvSecretAccessKey       = "AWS_SECRET_ACCESS_KEY"
	EnvSessionToken          = "AWS_SESSION_TOKEN"
	EnvMountpointCacheKey    = "UNSTABLE_MOUNTPOINT_CACHE_KEY"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment map[Key]Value

Environment represents a list of environment variables as key-value pairs.

func Default

func Default() Environment

Default returns list of environment variables to pass Mountpoint.

func (Environment) Delete

func (env Environment) Delete(key Key)

Delete deletes the environment variable with the specified key.

func (Environment) List

func (env Environment) List() []string

List returns a sorted slice of environment variables in "KEY=VALUE" format.

func (Environment) Merge

func (env Environment) Merge(other Environment)

Merge adds all key-value pairs from the given environment to the current environment. If a key exists in both environments, the value from the given environment takes precedence.

func (Environment) Set

func (env Environment) Set(key Key, value Value)

Set adds or updates the environment variable with the specified key and value.

type Key

type Key = string

Key represents an environment variable name.

type Value

type Value = string

Value represents an environment variable value.

func Region

func Region() Value

Region returns detected region from environment variables `AWS_REGION` or `AWS_DEFAULT_REGION`. It returns an empty string if both is unset.

Jump to

Keyboard shortcuts

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