Versions in this module Expand all Collapse all v0 v0.16.0 Dec 25, 2023 Changes in this version + func ArrayContains(a types.Array, v types.Value) (bool, error) + func ArrayLength(a types.Array) (int, error) + func CastAs(v types.Value, t types.ValueType) (types.Value, error) + func CastAsArray(v types.Value) (types.Value, error) + func CastAsBlob(v types.Value) (types.Value, error) + func CastAsBool(v types.Value) (types.Value, error) + func CastAsDouble(v types.Value) (types.Value, error) + func CastAsInteger(v types.Value) (types.Value, error) + func CastAsObject(v types.Value) (types.Value, error) + func CastAsText(v types.Value) (types.Value, error) + func CastAsTimestamp(v types.Value) (types.Value, error) + func CloneValue(v types.Value) (types.Value, error) + func Length(d types.Object) (int, error) + func MapScan(d types.Object, t any) error + func MarshalJSON(d types.Object) ([]byte, error) + func MarshalJSONArray(a types.Array) ([]byte, error) + func MaskFields(d types.Object, fields ...string) types.Object + func NewArrayFromSlice[T any](l []T) types.Array + func NewFromCSV(headers, columns []string) types.Object + func NewFromJSON(data []byte) types.Object + func NewFromMap[T any](m map[string]T) types.Object + func NewFromStruct(s interface{}) (types.Object, error) + func NewValue(x any) (types.Value, error) + func OnlyFields(d types.Object, fields ...string) types.Object + func Scan(d types.Object, targets ...interface{}) error + func ScanField(d types.Object, field string, dest interface{}) error + func ScanIterator(it Iterator, t interface{}) error + func ScanPath(d types.Object, path Path, dest interface{}) error + func ScanRow(d types.Object, t interface{}) error + func ScanValue(v types.Value, t any) error + func SliceScan(a types.Array, t interface{}) error + func StructScan(d types.Object, t interface{}) error + func WithSortedFields(d types.Object) types.Object + type ErrUnsupportedType struct + Msg string + Value interface{} + func (e *ErrUnsupportedType) Error() string + type FieldBuffer struct + func NewFieldBuffer() *FieldBuffer + func (fb *FieldBuffer) Add(field string, v types.Value) *FieldBuffer + func (fb *FieldBuffer) Apply(fn func(p Path, v types.Value) (types.Value, error)) error + func (fb *FieldBuffer) Copy(d types.Object) error + func (fb *FieldBuffer) Delete(path Path) error + func (fb *FieldBuffer) MarshalJSON() ([]byte, error) + func (fb *FieldBuffer) Replace(field string, v types.Value) error + func (fb *FieldBuffer) Reset() + func (fb *FieldBuffer) ScanCSV(headers, columns []string) + func (fb *FieldBuffer) ScanObject(d types.Object) error + func (fb *FieldBuffer) Set(path Path, v types.Value) error + func (fb *FieldBuffer) String() string + func (fb *FieldBuffer) UnmarshalJSON(data []byte) error + func (fb FieldBuffer) GetByField(field string) (types.Value, error) + func (fb FieldBuffer) Iterate(fn func(field string, value types.Value) error) error + func (fb FieldBuffer) Len() int + type Iterator interface + Iterate func(fn func(d types.Object) error) error + type Op struct + Path Path + Type string + Value types.Value + func Diff(d1, d2 types.Object) ([]Op, error) + func NewDeleteOp(path Path, v types.Value) Op + func NewSetOp(path Path, v types.Value) Op + func (o *Op) MarshalBinary() ([]byte, error) + type Path []PathFragment + func NewPath(fragments ...string) Path + func (p Path) Clone() Path + func (p Path) Extend(f ...PathFragment) Path + func (p Path) ExtendField(field string) Path + func (p Path) ExtendIndex(index int) Path + func (p Path) GetValueFromArray(a types.Array) (types.Value, error) + func (p Path) GetValueFromObject(d types.Object) (types.Value, error) + func (p Path) IsEqual(other Path) bool + func (p Path) String() string + type PathFragment struct + ArrayIndex int + FieldName string + type Paths []Path + func (p Paths) IsEqual(other Paths) bool + func (p Paths) String() string + type Scanner interface + ScanObject func(types.Object) error + type ValueBuffer struct + Values []types.Value + func NewValueBuffer(values ...types.Value) *ValueBuffer + func (vb *ValueBuffer) Append(v types.Value) *ValueBuffer + func (vb *ValueBuffer) Apply(fn func(p Path, v types.Value) (types.Value, error)) error + func (vb *ValueBuffer) Copy(a types.Array) error + func (vb *ValueBuffer) GetByIndex(i int) (types.Value, error) + func (vb *ValueBuffer) Iterate(fn func(i int, value types.Value) error) error + func (vb *ValueBuffer) Len() int + func (vb *ValueBuffer) Replace(index int, v types.Value) error + func (vb *ValueBuffer) Reset() + func (vb *ValueBuffer) ScanArray(a types.Array) error + func (vb *ValueBuffer) UnmarshalJSON(data []byte) error + func (vb ValueBuffer) MarshalJSON() ([]byte, error)