cuetil

package
v0.0.0-...-2016107 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendSplit

func AppendSplit(v cue.Value, splitBy cue.Op, a []cue.Value) []cue.Value

AppendSplit recursively splits an expression in a single cue.Value by a single operation, flattening it into the slice of cue.Value that are joined by the provided operation in the input value.

Most calls to this should pass nil for the third parameter.

func Equal

func Equal(val1 cue.Value, val2 cue.Value) error

Equal reports nil when the two cue values subsume each other or an error otherwise

func FirstNonThemaPos

func FirstNonThemaPos(v cue.Value) token.Pos

FirstNonThemaPos returns the first token.Pos in the slice returned by PoslistWithoutThema, or token.NoPos if no such pos exists.

func LastSelectorEq

func LastSelectorEq(p cue.Path, sel cue.Selector) bool

LastSelectorEq tests whether the final selector in the provided path is equivalent to the provided selector. Selectors that vary only by optionality are considered equivalent.

func PathHasPrefix

func PathHasPrefix(p, prefix cue.Path) bool

PathHasPrefix tests whether the cue.Path p begins with prefix.

func PathsAreEq

func PathsAreEq(p1, p2 cue.Path) bool

PathsAreEq tests whether two cue.Path are equivalent. Paths that vary only by optionality are considered equivalent.

func PoslistWithoutThema

func PoslistWithoutThema(v cue.Value) []token.Pos

PoslistWithoutThema returns all token.Pos associated with a given cue.Value, omitting any token.Pos that point to thema.

func PrintPosList

func PrintPosList(v cue.Value)

PrintPosList dumps the cue.Value.Pos for each unified element of the provided cue.Value.

Useful for debugging values with complex multiple unified antecedents.

func ReplacePathPrefix

func ReplacePathPrefix(p, oldprefix, newprefix cue.Path) cue.Path

ReplacePathPrefix replaces oldprefix with newprefix if p begins with oldprefix.

func SelEq

func SelEq(s1, s2 cue.Selector) bool

SelEq indicates whether two selectors are equivalent. Selectors are equivalent if they are either exactly equal, or if they are equal ignoring path optionality.

func TrimPathPrefix

func TrimPathPrefix(path, prefix cue.Path) cue.Path

TrimPathPrefix strips the provided prefix from the provided path, if the prefix exists.

If path and prefix are equivalent, and there is at least one additional selector in the provided path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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