ctytree

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Children map[string]*Node
	Value    cty.Value
}

Node is a node in tree structure that has children or value If value is set it will assume there are no children, only used for last node in tree

func CreateTree

func CreateTree(values map[string]cty.Value) *Node

CreateTree creates a new node tree based on the value map sent in. It will parse the keys as dot separated paths, ie. dependency.test.outputs.id and create a node tree where instead of key being dot separated it will have a root node called "dependency" that has child "test" and so on.

Returns the root node with all top level nodes

func (Node) ToCtyMap

func (n Node) ToCtyMap() map[string]cty.Value

ToCtyMap converts the node tree back to a map of cty.Value's where cty.Values are type cty.ObjectVal to represent the hierarchy of nodes

Jump to

Keyboard shortcuts

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