envloader

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 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

NewLocalEnvLoader instantiates a new AwsSecretsManagerEnvLoader instance

func (*AwsSecretsManagerEnvLoader) GetAndLogEnvVar added in v0.1.6

func (l *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 added in v0.1.6

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