Documentation
¶
Overview ¶
Package json converts JSON to CUE. To convert CUE to JSON, use encoding/json.Marshal on a cue.Value.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Extract ¶ added in v0.0.12
Extract parses JSON-encoded data to a CUE expression, using path for position information.
Types ¶
type Decoder ¶ added in v0.0.12
type Decoder struct {
// contains filtered or unexported fields
}
A Decoder converts JSON values to CUE.
func NewDecoder ¶ added in v0.0.12
NewDecoder configures a JSON decoder. The path is used to associate position information with each node. The runtime may be nil if the decoder is only used to extract to CUE ast objects.
The runtime argument is a historical remnant and unused.
type Pointer ¶ added in v0.15.0
type Pointer string
Pointer represents a JSON Pointer as defined by RFC 6901. It is a slash-separated list of tokens that reference a specific location within a JSON document. TODO(go1.26) alias this to encoding/json/jsontext.Pointer
func PointerFromCUEPath ¶ added in v0.15.0
PointerFromCUEPath returns a JSON Pointer equivalent to the given CUE path. It returns an error if the path contains an element that cannot be represented as a JSON Pointer.
func PointerFromTokens ¶ added in v0.15.0
PointerFromTokens returns a JSON Pointer formed from the unquoted tokens in the given sequence. Any slash (/) or tilde (~) characters will be escaped appropriately.