envloader

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSSecretsManagerEnvLoader

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

AWSSecretsManagerEnvLoader is an EnvLoader implementation which loads variables from an AWS SecretsManager secret

func NewAWSSecretsManagerEnvLoader

func NewAWSSecretsManagerEnvLoader(secretName string, region string, version string, logger *logs.Logger) *AWSSecretsManagerEnvLoader

NewAWSSecretsManagerEnvLoader instantiates a new AWSSecretsManagerEnvLoader instance

func (*AWSSecretsManagerEnvLoader) GetAndLogEnvVar

func (a *AWSSecretsManagerEnvLoader) GetAndLogEnvVar(key string, required bool, sensitive bool) string

GetAndLogEnvVar implements EnvLoader

func (*AWSSecretsManagerEnvLoader) GetEnvVar

func (a *AWSSecretsManagerEnvLoader) GetEnvVar(key string, required bool) string

GetEnvVar implements EnvLoader

type EnvLoader

type EnvLoader interface {
	// GetEnvVar returns the environment variable value with the specified key
	// 	If required and key is not found, a fatal log will be generated. Otherwise an empty string is returned
	GetEnvVar(key string, required bool) string
	// GetAndLogEnvVar returns and logs the environment variable value with the specified key
	// 	If required and key is not found, a fatal log will be generated. Otherwise an empty string is returned
	// 	If sensitive, the value of the environment variable will not be logged
	GetAndLogEnvVar(key string, required bool, sensitive bool) string
}

EnvLoader is an interface to assist with environment variable loading

func NewEnvLoader

func NewEnvLoader(version string, logger *logs.Logger) EnvLoader

NewEnvLoader initializes and returns an EnvLoader, using AWSSecretsManagerEnvLoader if configured

type LocalEnvLoader

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

LocalEnvLoader is an EnvLoader implementation which loads variables from the local system environment

func NewLocalEnvLoader

func NewLocalEnvLoader(version string, logger *logs.Logger) *LocalEnvLoader

NewLocalEnvLoader instantiates a new LocalEnvLoader instance

func (*LocalEnvLoader) GetAndLogEnvVar

func (l *LocalEnvLoader) GetAndLogEnvVar(key string, required bool, sensitive bool) string

GetAndLogEnvVar implements EnvLoader

func (*LocalEnvLoader) GetEnvVar

func (l *LocalEnvLoader) GetEnvVar(key string, required bool) string

GetEnvVar implements EnvLoader

Jump to

Keyboard shortcuts

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