gocty

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct{}

Decoder contains helpers for decoding go-cty values to native go types.

func (*Decoder) GetBool

func (*Decoder) GetBool(ctyVal cty.Value) bool

GetBool gets a boolean from a cty value.

func (*Decoder) GetInt

func (*Decoder) GetInt(ctyVal cty.Value) int

GetInt gets an integer from a cty value.

func (*Decoder) GetMap

func (*Decoder) GetMap(ctyVal cty.Value) *map[string]string

GetMap will get a map of strings from a cty value map. Booleans will be converted to strings to keep things simple right now and no other types are supported yet.

func (*Decoder) GetString

func (*Decoder) GetString(ctyVal cty.Value) string

GetString gets a string from a cty value.

func (*Decoder) GetStringOrBool

func (*Decoder) GetStringOrBool(ctyVal cty.Value) string

GetStringOrBool will get a string from a cty value (of types string or boolean).

type Encoder

type Encoder struct{}

Encoder contains helpers for encoding native go types to go-cty values.

func (*Encoder) BoolVal

func (*Encoder) BoolVal(val bool) cty.Value

BoolVal takes a boolean and returns a cty value.

func (*Encoder) IntVal

func (*Encoder) IntVal(val int64) cty.Value

IntVal takes an int64 and returns a cty value.

func (*Encoder) ListVal

func (*Encoder) ListVal(val []cty.Value) cty.Value

ListVal takes a list of cty values and returns a cty value of type list.

func (*Encoder) MapVal

func (*Encoder) MapVal(val map[string]cty.Value) cty.Value

ListVal takes a map of cty values and returns a cty value of type list.

func (*Encoder) StringVal

func (*Encoder) StringVal(val string) cty.Value

StringVal takes a string and returns a cty value.

type OutputValue

type OutputValue struct {
	Name  string
	Type  string
	Value cty.Value
}

OutputValue is not yet used but organizes plugins outputs. The end goal is going to be to make it even easier for plugins to deal with inputs/outputs with a layer of abstraction in between them and go-cty.

Jump to

Keyboard shortcuts

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