Documentation
¶
Overview ¶
Package jason helps deal with dynamic JSON.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsA ¶ added in v0.4.0
AsA unmarshals j into a value of type T.
Example of converting j into a time instant:
if v, err := jason.AsA[time.Time](j); err == nil { ... }
Types ¶
type Array ¶
type Array = []any
Array is a JSON array: an ordered collection of values.
Example of an Array literal:
jason.Array{1, 2, 3}
type Number ¶
Number is an encoded JSON number.
It has arbitrary precision, and can be easily converted to a float64 or int64.
Example of a Number literal:
jason.Number("10")
type Object ¶
Object is a JSON object: an unordered set of name/value pairs.
Example of an Object literal:
jason.Object{"abc": true}
type RawValue ¶ added in v0.3.0
type RawValue = json.RawMessage
RawValue is a raw encoded JSON value.
It implements json.Marshaler and json.Unmarshaler, and can be used to delay/precompute JSON decoding/encoding.
Example of a RawValue literal:
jason.RawValue("false")
Click to show internal directories.
Click to hide internal directories.