cuerious

package module
v0.0.0-...-0151996 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Apache-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 ExprNode

type ExprNode struct {

	// The cue.Value corresponding to this node in the expression tree.
	V cue.Value
	// contains filtered or unexported fields
}

ExprNode is the node element from which an ExprTree is constructed.

Each ExprNode which corresponds to exactly one cue.Value, stored in ExprNode.Self. ExprNodes contain connections to each other through one of three types of links:

  • Expr link: the child is one element of a larger CUE expression represented by the parent (returns from cue.Value.Expr on parent).
  • Default link: the child is a default value of the parent (returns from cue.Value.Default)
  • Dereference link: the parent is a reference to the child (returns from cue.Dereference)

func ExprTree

func ExprTree(v cue.Value) *ExprNode

ExprTree constructs a tree-ish of nodes representing the expression structure contained within the provided cue.Value.

ExprTree is represented as a set of interlinked pointers to ExprNode, each of which corresponds to exactly one cue.Value, ExprNode.Self. ExprNodes are connected through one of three types of links:

  • Expr links, where calling cue.Value.Expr on the
  • Dereference links, where the parentl

Structural CUE elements - like the fields of structs - are NOT represented in this tree.

An ExprNode structure is NOT currently safe for use from multiple goroutines.

Returns nil if the provided value contains structural cycles.

func (*ExprNode) String

func (n *ExprNode) String() string

func (*ExprNode) Walk

func (n *ExprNode) Walk(fn func(x *ExprNode) bool)

Walk does a pre-order traversal of the tree, calling the provided walk function for each visited ExprNode. If the function returns false for any node, children of that node are not visited.

Directories

Path Synopsis
internal
cuetest
Package testing is a helper package for test packages in the CUE project.
Package testing is a helper package for test packages in the CUE project.

Jump to

Keyboard shortcuts

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