common

package
v0.0.0-...-0d862b9 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSON

func DecodeJSON(data map[string]interface{}, v interface{}) error

DecodeJSON decodes the map object into the target struct.

func HclWriteBlocks

func HclWriteBlocks(blocks []*HCLResourceBlock) ([]byte, error)

HclWriteBlocks prints HCLResourceBlock objects as string.

func MapToCtyValWithSchema

func MapToCtyValWithSchema(m map[string]interface{}, s map[string]*schema.Schema) (cty.Value, error)

MapToCtyValWithSchema normalizes and converts resource from untyped map format to TF JSON.

Normalization is a post-processing of the output map, which does the following: * Converts unmarshallable "schema.Set" to marshallable counterpart. * Strips out properties, which are not part ofthe resource TF schema.

func NewConfig

func NewConfig() *transport_tpg.Config

func ParseFieldValue

func ParseFieldValue(url string, name string) string

ParseFieldValue extracts named part from resource url.

Types

type Converter

type Converter interface {
	// Convert turns assets into hcl blocks.
	Convert(asset []*caiasset.Asset) ([]*HCLResourceBlock, error)
}

Converter interface for resources.

type HCLResourceBlock

type HCLResourceBlock struct {
	Labels []string
	Value  cty.Value
}

HCLResourceBlock identifies the HCL block's labels and content.

Jump to

Keyboard shortcuts

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