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 New(name string) *EnvironmentVariableParameter
func NewWithDefault ¶
func NewWithDefault(name string, defaultValue string) *EnvironmentVariableParameter
func (*EnvironmentVariableParameter) GetReferences ¶
func (p *EnvironmentVariableParameter) GetReferences() []parameter.ParameterReference
func (*EnvironmentVariableParameter) GetType ¶
func (p *EnvironmentVariableParameter) GetType() string
func (*EnvironmentVariableParameter) ResolveValue ¶
func (p *EnvironmentVariableParameter) ResolveValue(context parameter.ResolveContext) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.