variables

package
v0.11.11 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2018 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package variables provides functions and types for working with Terraform variables provided as input.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Merge

func Merge(a, b map[string]interface{}) map[string]interface{}

Merge merges raw variable values b into a.

The parameters given here should be the full map of set variables, such as those created by Flag and FlagFile.

The merge behavior is to override the top-level key except for map types. Map types are merged together by key. Any other types are overwritten: primitives and lists.

This returns the resulting map. This merges into a but if a is nil a new map will be allocated. A non-nil "a" value is returned regardless.

func ParseInput

func ParseInput(value string) (interface{}, error)

ParseInput parses a manually inputed variable to a richer value.

This will turn raw input into rich types such as `[]` to a real list or `{}` to a real map. This function should be used to parse any manual untyped input for variables in order to provide a consistent experience.

Types

type Flag

type Flag map[string]interface{}

Flag a flag.Value implementation for parsing user variables from the command-line in the format of '-var key=value', where value is a type intended for use as a Terraform variable.

func (*Flag) Set

func (v *Flag) Set(raw string) error

func (*Flag) String

func (v *Flag) String() string

type FlagAny added in v0.9.1

type FlagAny map[string]interface{}

FlagAny is a flag.Value for parsing user variables in the format of 'key=value' OR a file path. 'key=value' is assumed if '=' is in the value. You cannot use a file path that contains an '='.

func (*FlagAny) Set added in v0.9.1

func (v *FlagAny) Set(raw string) error

func (*FlagAny) String added in v0.9.1

func (v *FlagAny) String() string

type FlagFile

type FlagFile map[string]interface{}

FlagFile is a flag.Value implementation for parsing user variables from the command line in the form of files. i.e. '-var-file=foo'

func (*FlagFile) Set

func (v *FlagFile) Set(raw string) error

func (*FlagFile) String

func (v *FlagFile) String() string

Jump to

Keyboard shortcuts

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