cue

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CueKindOf

func CueKindOf(v cue.Value, path string) cue.Kind

CueKindOf returns cue.Kind of the value placed at the given path.

func CueKuestaTagOf

func CueKuestaTagOf(v cue.Value, path string) (string, error)

CueKuestaTagOf returns the tag written in comment.

func FormatCue

func FormatCue(v cue.Value, opts ...cue.Option) ([]byte, error)

FormatCue formats cue.Value in canonical cue fmt style.

func GetKuestaTag

func GetKuestaTag(v cue.Value) (string, error)

GetKuestaTag extracts the value tagged with 'kuesta' key from ast.CommentGroup.

func NewAstExpr

func NewAstExpr(value any) ast.Expr

NewAstExpr returns CUE AST Expression for the given value.

func NewValueFromBytes

func NewValueFromBytes(cctx *cue.Context, buf []byte) (cue.Value, error)

NewValueFromBytes creates cue.Value from given []byte.

func NewValueFromJson deprecated

func NewValueFromJson(cctx *cue.Context, buf []byte) (cue.Value, error)

NewValueFromJson creates cue.Value from the given JSON []byte.

Deprecated: cuejson.Extract causes decoding to wrong type. Use json.UnMarshal to map[string]any and NewAstExpr instead.

func NewValueWithInstance

func NewValueWithInstance(cctx *cue.Context, entrypoints []string, loadcfg *load.Config) (cue.Value, error)

NewValueWithInstance creates cue.Value from cue build.Instance to resolve dependent imports.

Types

type StrConvFunc

type StrConvFunc func(string) (any, error)

func NewStrConvFunc

func NewStrConvFunc(kind cue.Kind) (StrConvFunc, error)

NewStrConvFunc returns StrConvFunc to convert string to the corresponding type of the given cue.Kind.

Jump to

Keyboard shortcuts

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