Documentation
¶
Overview ¶
Package value boxes decoded-JSON data behind a typed accessor API. It is the single place dynamic typing (any) lives in the runner; every other package is statically typed and reaches runtime data only through a value.Value.
Index ¶
- type Map
- type Value
- func (v Value) Bool() (bool, bool)
- func (v Value) Get(path string) (Value, bool)
- func (v Value) Int() (int64, bool)
- func (v Value) IsZero() bool
- func (v Value) List() ([]Value, bool)
- func (v Value) MarshalJSON() ([]byte, error)
- func (v Value) Raw() any
- func (v Value) Str() (string, bool)
- func (v Value) String() string
- func (v *Value) UnmarshalJSON(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value boxes one decoded-JSON value. The zero Value is absent (see IsZero).
func (Value) Get ¶
Get resolves an RFC-9535 JSONPath into the value, reporting whether it matched. A bare dotted path ("body.id", "headers.content-type", a hyphenated node id like "create-user.id") resolves member-by-member — every member name is addressable; a path already starting with "$" is used verbatim so full JSONPath ("$.items[*].id", "$.data[?@.active]") works. A single match returns that value; multiple matches return a list.
func (Value) MarshalJSON ¶
MarshalJSON renders the boxed value back to JSON (for results crossing the wire).
func (*Value) UnmarshalJSON ¶
UnmarshalJSON boxes decoded JSON directly — the one pointer-receiver method (json must write through). It lets a node config declare value.Value / value.Map fields that decode in a single pass, instead of holding json.RawMessage and re-parsing it on every evaluation.