values

package
v0.0.0-...-900be4e Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package values is a set of value types to use in provisioning. They add custom unmarshaling logic that puts the string values through os.ExpandEnv. Usage:

type Data struct {
  Field StringValue `yaml:"field"` // Instead of string
}

d := &Data{} // unmarshal into d d.Field.Value() // returns the final interpolated value from the yaml file

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolValue

type BoolValue struct {
	Raw string
	// contains filtered or unexported fields
}

BoolValue represents a string value in a YAML config that can be overridden by environment variables

func (*BoolValue) UnmarshalYAML

func (val *BoolValue) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML converts YAML into an *BoolValue

func (*BoolValue) Value

func (val *BoolValue) Value() bool

Value returns the wrapped bool value

type Int64Value

type Int64Value struct {
	Raw string
	// contains filtered or unexported fields
}

Int64Value represents a string value in a YAML config that can be overridden by environment variables

func (*Int64Value) UnmarshalYAML

func (val *Int64Value) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML converts YAML into an *Int64Value

func (*Int64Value) Value

func (val *Int64Value) Value() int64

Value returns the wrapped int64 value

type IntValue

type IntValue struct {
	Raw string
	// contains filtered or unexported fields
}

IntValue represents a string value in a YAML config that can be overridden by environment variables

func (*IntValue) UnmarshalYAML

func (val *IntValue) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML converts YAML into an *IntValue

func (*IntValue) Value

func (val *IntValue) Value() int

Value returns the wrapped int value

type JSONValue

type JSONValue struct {
	Raw map[string]interface{}
	// contains filtered or unexported fields
}

JSONValue represents a string value in a YAML config that can be overridden by environment variables

func (*JSONValue) UnmarshalYAML

func (val *JSONValue) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML converts YAML into an *JSONValue

func (*JSONValue) Value

func (val *JSONValue) Value() map[string]interface{}

Value returns the wrapped JSON value as map[string]interface{}

type StringMapValue

type StringMapValue struct {
	Raw map[string]string
	// contains filtered or unexported fields
}

StringMapValue represents a string value in a YAML config that can be overridden by environment variables

func (*StringMapValue) UnmarshalYAML

func (val *StringMapValue) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML converts YAML into an *StringMapValue

func (*StringMapValue) Value

func (val *StringMapValue) Value() map[string]string

Value returns the wrapped map[string]string value

type StringValue

type StringValue struct {
	Raw string
	// contains filtered or unexported fields
}

StringValue represents a string value in a YAML config that can be overridden by environment variables

func (*StringValue) UnmarshalYAML

func (val *StringValue) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML converts YAML into an *StringValue

func (*StringValue) Value

func (val *StringValue) Value() string

Value returns the wrapped string value

Jump to

Keyboard shortcuts

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