environment

package
v2.17.4 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const EnvironmentVariableParameterType = "environment"

EnvironmentVariableParameterType specifies the type of the parameter used in config files

Variables

View Source
var EnvironmentVariableParameterSerde = parameter.ParameterSerDe{
	Serializer:   writeEnvironmentValueParameter,
	Deserializer: parseEnvironmentValueParameter,
}

Functions

This section is empty.

Types

type EnvironmentVariableParameter

type EnvironmentVariableParameter struct {
	// name of the referenced environment variable
	Name string

	// flag indicating that a default value has been set. this is needed, as
	// we cannot distinguish an empty string from an not set value.
	HasDefaultValue bool

	// default value used if environment variable specified by `name` cannot be found.
	// note: this value is only used, if the `HasDefaultValue` flag is set to true.
	DefaultValue string
}

EnvironmentVariableParameter defines a parameter which can load an value from the environment variables. there is even the possibility to define a default value, if the one from the environment is missing.

func New

func NewWithDefault

func NewWithDefault(name string, defaultValue string) *EnvironmentVariableParameter

func (*EnvironmentVariableParameter) GetReferences

func (*EnvironmentVariableParameter) GetType

func (p *EnvironmentVariableParameter) GetType() string

func (*EnvironmentVariableParameter) ResolveValue

func (p *EnvironmentVariableParameter) ResolveValue(context parameter.ResolveContext) (interface{}, error)

Jump to

Keyboard shortcuts

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