structural

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LIST_ERR listProc = iota // unknown arg
	LIST_AND                 // all apply
	LIST_OR                  // any apply
	LIST_PER                 // pairwise
)

Variables

This section is empty.

Functions

func DiffValue

func DiffValue(orig, next cue.Value, opts *Options) (cue.Value, error)

func FormatCueError

func FormatCueError(err error) string

func GetLabel

func GetLabel(val cue.Value) cue.Selector

func InsertValue

func InsertValue(ins, val cue.Value, opts *Options) (cue.Value, error)

func LoadCueInputs

func LoadCueInputs(entrypoints []string, ctx *cue.Context, cfg *load.Config) (cue.Value, error)

Loads the entrypoints using the context provided returns the value from the load after validating it

func MaskValue

func MaskValue(mask, val cue.Value, opts *Options) (cue.Value, error)

func PatchValue

func PatchValue(patch, val cue.Value, opts *Options) (cue.Value, error)

func PickValue

func PickValue(pick, from cue.Value, opts *Options) (cue.Value, error)

PickValue uses 'pick' to pick a subvalue from 'from' by checking if values unify

func ReplaceValue

func ReplaceValue(repl, val cue.Value, opts *Options) (cue.Value, error)

func RequireValue

func RequireValue(require, from cue.Value, opts *Options) error

RequireValue uses 'require' to require a subvalue from 'from' by checking if values unify

func UpsertValue

func UpsertValue(up, val cue.Value, opts *Options) (cue.Value, error)

func Walk

func Walk(v cue.Value, before func(cue.Value) bool, after func(cue.Value), options ...cue.Option)

Walk is an alternative to cue.Value.Walk which handles more field types You can customize this with your own options

Types

type Input

type Input struct {
	Original    string
	Entrypoints []string
	Filename    string
	Filetype    string // yaml, json, cue... toml?
	Expression  string // cue expression to select within document
	Content     []byte
	Value       cue.Value
}

func LoadGlobs

func LoadGlobs(globs []string) ([]Input, error)

type Options

type Options struct {
	AllTypeErrors  bool
	NodeTypeErrors bool
}

Jump to

Keyboard shortcuts

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