package value

import "cuelang.org/go/internal/value"

Package value contains functions for converting values to internal types and various other Value-related utilities.

Index

Functions

func ConvertToContext

func ConvertToContext(r *cue.Runtime) *cue.Context

func ConvertToRuntime

func ConvertToRuntime(c *cue.Context) *cue.Runtime

func EvalExpr

func EvalExpr(value cue.Value, expr ast.Expr) cue.Value

EvalExpr evaluates an expression within an existing struct value. Identifiers only resolve to values defined within the struct.

Expressions may refer to builtin packages if they can be uniquely identified

func FromGoType

func FromGoType(r *cue.Context, x interface{}) cue.Value

func FromGoValue

func FromGoValue(r *cue.Context, x interface{}, nilIsTop bool) cue.Value

func Make

func Make(ctx *adt.OpContext, v adt.Value) cue.Value

Make wraps cue.MakeValue.

func MakeError

func MakeError(r *runtime.Runtime, err errors.Error) cue.Value

func ToInternal

func ToInternal(v cue.Value) (*runtime.Runtime, *adt.Vertex)

func UnifyBuiltin

func UnifyBuiltin(v cue.Value, kind string) cue.Value

UnifyBuiltin returns the given Value unified with the given builtin template.

Source Files

value.go

Version
v0.4.0-alpha.2
Published
Apr 23, 2021
Platform
darwin/amd64
Imports
10 packages
Last checked
14 minutes ago

Tools for package owners.