env

package
v1.13.6 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvironmentVariables

func EnvironmentVariables() map[Variable]VariableOpts

func Getenv

func Getenv(name Variable) string

func LookupEnv

func LookupEnv(name Variable) (string, bool)

Types

type Variable

type Variable string

Variable is a type representing an environment variable

const (
	// Cosign environment variables
	VariableExperimental     Variable = "COSIGN_EXPERIMENTAL"
	VariableDockerMediaTypes Variable = "COSIGN_DOCKER_MEDIA_TYPES"
	VariablePassword         Variable = "COSIGN_PASSWORD"
	VariablePKCS11Pin        Variable = "COSIGN_PKCS11_PIN"
	VariablePKCS11ModulePath Variable = "COSIGN_PKCS11_MODULE_PATH"
	VariableRepository       Variable = "COSIGN_REPOSITORY"

	// Sigstore environment variables
	VariableSigstoreCTLogPublicKeyFile Variable = "SIGSTORE_CT_LOG_PUBLIC_KEY_FILE"
	VariableSigstoreRootFile           Variable = "SIGSTORE_ROOT_FILE"
	VariableSigstoreRekorPublicKey     Variable = "SIGSTORE_REKOR_PUBLIC_KEY"

	// Other external environment variables
	VariableGitHubToken              Variable = "GITHUB_TOKEN" //nolint:gosec
	VariableGitHubRequestToken       Variable = "ACTIONS_ID_TOKEN_REQUEST_TOKEN"
	VariableGitHubRequestURL         Variable = "ACTIONS_ID_TOKEN_REQUEST_URL"
	VariableSPIFFEEndpointSocket     Variable = "SPIFFE_ENDPOINT_SOCKET"
	VariableGoogleServiceAccountName Variable = "GOOGLE_SERVICE_ACCOUNT_NAME"
	VariableGitLabHost               Variable = "GITLAB_HOST"
	VariableGitLabToken              Variable = "GITLAB_TOKEN"
)

func (Variable) String

func (v Variable) String() string

type VariableOpts

type VariableOpts struct {
	// Description contains description for the environment variable
	Description string
	// Expects describes what value is expected by the environment variable
	Expects string
	// Sensitive is used for environment variables with sensitive values
	// (e.g. passwords, credentials, etc.)
	Sensitive bool
	// External is used for environment variables coming from external projects
	// and dependencies (e.g. GITHUB_TOKEN, SIGSTORE_, TUF_)
	External bool
}

VariableOpts closely describes a Variable

Jump to

Keyboard shortcuts

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