terra

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

Converter converts Terraform formatted data to and from object types.

func New

func New() *Converter

New returns a new converter.

func (*Converter) Expand

func (c *Converter) Expand(v, obj any) error

Expand converts Terraform-formatted data into the given object.

func (*Converter) Flatten

func (c *Converter) Flatten(obj any, s map[string]*schema.Schema) (any, error)

Flatten converts an object into a Terraform data structure using its schema.

func (*Converter) Register

func (c *Converter) Register(v any, expand, flatten ConverterFn)

Register registers a custom type conversion.

type ConverterFn

type ConverterFn func(v any) (any, error)

ConverterFn is a function that can convert a value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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