Documentation ¶
Index ¶
- Variables
- func AnyWrap(t typ.Type) *typ.Wrap
- func AssignPath(mut Mut, path cor.Path, val Val) (err error)
- func Compare(x, y Val) (int8, error)
- func Conv(reg Reg, t reflect.Type, val Val) (reflect.Value, error)
- func Equal(x, y Val) bool
- func ParseInto(str string, mut Mut) error
- func PrintZero(p *bfr.P, t typ.Type) error
- func ReadInto(r io.Reader, name string, mut Mut) error
- func UpdateRegs(rs, o *Regs)
- func Wrap(m Mut, t typ.Type) *typ.Wrap
- type Any
- func (w *Any) As(t typ.Type) (Val, error)
- func (w *Any) Assign(v Val) error
- func (w *Any) MarshalJSON() ([]byte, error)
- func (w *Any) Mut() Mut
- func (w *Any) New() Mut
- func (w *Any) Nil() bool
- func (w *Any) Parse(a ast.Ast) (err error)
- func (w *Any) Print(p *bfr.P) error
- func (w *Any) Ptr() interface{}
- func (w *Any) String() string
- func (w *Any) Type() typ.Type
- func (w *Any) UnmarshalJSON(b []byte) error
- func (w *Any) Unwrap() Val
- func (w *Any) Value() Val
- func (w *Any) Zero() bool
- type AnyPrx
- func (x *AnyPrx) As(t typ.Type) (Val, error)
- func (x *AnyPrx) Assign(v Val) (err error)
- func (x *AnyPrx) MarshalJSON() ([]byte, error)
- func (x *AnyPrx) Mut() Mut
- func (x *AnyPrx) New() Mut
- func (x *AnyPrx) NewWith(v reflect.Value) Mut
- func (x *AnyPrx) Nil() bool
- func (x *AnyPrx) Parse(a ast.Ast) (err error)
- func (x *AnyPrx) Print(b *bfr.P) error
- func (x *AnyPrx) Ptr() interface{}
- func (x *AnyPrx) Reflect() reflect.Value
- func (x *AnyPrx) String() string
- func (x *AnyPrx) Type() typ.Type
- func (x *AnyPrx) UnmarshalJSON(b []byte) error
- func (x *AnyPrx) Unwrap() Val
- func (x *AnyPrx) Value() Val
- func (x *AnyPrx) Zero() bool
- type Appender
- type Bool
- type BoolMut
- func (v *BoolMut) As(t typ.Type) (Val, error)
- func (v *BoolMut) Assign(p Val) error
- func (v *BoolMut) MarshalJSON() ([]byte, error)
- func (v *BoolMut) Mut() Mut
- func (*BoolMut) New() Mut
- func (v *BoolMut) Nil() bool
- func (v *BoolMut) Parse(a ast.Ast) error
- func (v *BoolMut) Print(p *bfr.P) error
- func (v *BoolMut) Ptr() interface{}
- func (v *BoolMut) String() string
- func (*BoolMut) Type() typ.Type
- func (v *BoolMut) Value() Val
- func (v *BoolMut) Zero() bool
- type Char
- func (s Char) As(t typ.Type) (Val, error)
- func (s Char) Len() int
- func (s Char) MarshalJSON() ([]byte, error)
- func (s Char) Mut() Mut
- func (s Char) Nil() bool
- func (s Char) Print(p *bfr.P) error
- func (s Char) String() string
- func (Char) Type() typ.Type
- func (s Char) Value() Val
- func (s Char) Zero() bool
- type CharMut
- func (s *CharMut) As(t typ.Type) (Val, error)
- func (s *CharMut) Assign(p Val) error
- func (s *CharMut) Len() int
- func (s *CharMut) MarshalJSON() ([]byte, error)
- func (s *CharMut) Mut() Mut
- func (*CharMut) New() Mut
- func (s *CharMut) Nil() bool
- func (s *CharMut) Parse(a ast.Ast) error
- func (s *CharMut) Print(p *bfr.P) error
- func (s *CharMut) Ptr() interface{}
- func (s *CharMut) String() string
- func (*CharMut) Type() typ.Type
- func (s *CharMut) Value() Val
- func (s *CharMut) Zero() bool
- type Delta
- type Dict
- type EditFunc
- type Idxr
- type Int
- type IntMut
- func (i *IntMut) As(t typ.Type) (Val, error)
- func (i *IntMut) Assign(p Val) error
- func (i *IntMut) MarshalJSON() ([]byte, error)
- func (i *IntMut) Mut() Mut
- func (*IntMut) New() Mut
- func (i *IntMut) Nil() bool
- func (i *IntMut) Parse(a ast.Ast) error
- func (i *IntMut) Print(p *bfr.P) error
- func (i *IntMut) Ptr() interface{}
- func (i *IntMut) String() string
- func (*IntMut) Type() typ.Type
- func (i *IntMut) Value() Val
- func (i *IntMut) Zero() bool
- type IntPrx
- func (x *IntPrx) As(t typ.Type) (Val, error)
- func (x *IntPrx) Assign(v Val) error
- func (x *IntPrx) MarshalJSON() ([]byte, error)
- func (x *IntPrx) Mut() Mut
- func (x *IntPrx) New() Mut
- func (x *IntPrx) NewWith(v reflect.Value) Mut
- func (x *IntPrx) Nil() bool
- func (x *IntPrx) Parse(a ast.Ast) error
- func (x *IntPrx) Print(p *bfr.P) error
- func (x *IntPrx) Ptr() interface{}
- func (x *IntPrx) Reflect() reflect.Value
- func (x *IntPrx) String() string
- func (x *IntPrx) Type() typ.Type
- func (x *IntPrx) UnmarshalJSON(b []byte) error
- func (x *IntPrx) Value() Val
- func (x *IntPrx) Zero() bool
- type KeyVal
- type Keyed
- func (d *Keyed) As(t typ.Type) (Val, error)
- func (d *Keyed) Assign(p Val) error
- func (d *Keyed) Idx(i int) (Val, error)
- func (d *Keyed) IterIdx(it func(int, Val) error) error
- func (d *Keyed) IterKey(it func(string, Val) error) error
- func (d *Keyed) Key(k string) (Val, error)
- func (d *Keyed) Keys() []string
- func (d *Keyed) Len() int
- func (d Keyed) MarshalJSON() ([]byte, error)
- func (d *Keyed) Mut() Mut
- func (d *Keyed) New() Mut
- func (d *Keyed) Nil() bool
- func (d *Keyed) Parse(a ast.Ast) error
- func (d Keyed) Print(p *bfr.P) (err error)
- func (d *Keyed) Ptr() interface{}
- func (d *Keyed) SetIdx(i int, el Val) error
- func (d *Keyed) SetKey(k string, el Val) error
- func (d Keyed) String() string
- func (d Keyed) Type() typ.Type
- func (d *Keyed) UnmarshalJSON(b []byte) error
- func (d *Keyed) Value() Val
- func (d *Keyed) Zero() bool
- type Keyr
- type Lenr
- type List
- type ListOp
- type ListOps
- type ListPrx
- func (x *ListPrx) Append(vs ...Val) (err error)
- func (x *ListPrx) As(t typ.Type) (Val, error)
- func (x *ListPrx) Assign(v Val) (err error)
- func (x *ListPrx) Idx(i int) (res Val, err error)
- func (x *ListPrx) IterIdx(it func(int, Val) error) error
- func (x *ListPrx) Len() int
- func (x *ListPrx) MarshalJSON() ([]byte, error)
- func (x *ListPrx) Mut() Mut
- func (x *ListPrx) New() Mut
- func (x *ListPrx) NewWith(v reflect.Value) Mut
- func (x *ListPrx) Nil() bool
- func (x *ListPrx) Parse(a ast.Ast) error
- func (x *ListPrx) Print(p *bfr.P) error
- func (x *ListPrx) Ptr() interface{}
- func (x *ListPrx) Reflect() reflect.Value
- func (x *ListPrx) SetIdx(i int, v Val) (err error)
- func (x *ListPrx) String() string
- func (x *ListPrx) Type() typ.Type
- func (x *ListPrx) UnmarshalJSON(b []byte) error
- func (x *ListPrx) Value() Val
- func (x *ListPrx) Zero() bool
- type Map
- func (h *Map) As(t typ.Type) (Val, error)
- func (h *Map) Assign(p Val) error
- func (h *Map) IterKey(it func(string, Val) error) error
- func (h *Map) Key(k string) (Val, error)
- func (h *Map) Keys() []string
- func (h *Map) Len() int
- func (h *Map) MarshalJSON() ([]byte, error)
- func (h *Map) Mut() Mut
- func (h *Map) New() Mut
- func (h *Map) Nil() bool
- func (h *Map) Parse(a ast.Ast) error
- func (h *Map) Print(p *bfr.P) (err error)
- func (h *Map) Ptr() interface{}
- func (h *Map) SetKey(k string, el Val) error
- func (h *Map) String() string
- func (h *Map) Type() typ.Type
- func (h *Map) UnmarshalJSON(b []byte) error
- func (h *Map) Value() Val
- func (h *Map) Zero() bool
- type MapPrx
- func (x *MapPrx) As(t typ.Type) (Val, error)
- func (x *MapPrx) Assign(v Val) error
- func (x *MapPrx) IterKey(it func(string, Val) error) error
- func (x *MapPrx) Key(k string) (Val, error)
- func (x *MapPrx) Keys() []string
- func (x *MapPrx) Len() int
- func (x *MapPrx) MarshalJSON() ([]byte, error)
- func (x *MapPrx) Mut() Mut
- func (x *MapPrx) New() Mut
- func (x *MapPrx) NewWith(v reflect.Value) Mut
- func (x *MapPrx) Nil() bool
- func (x *MapPrx) Parse(a ast.Ast) error
- func (x *MapPrx) Print(p *bfr.P) error
- func (x *MapPrx) Ptr() interface{}
- func (x *MapPrx) Reflect() reflect.Value
- func (x *MapPrx) SetKey(k string, v Val) (err error)
- func (x *MapPrx) String() string
- func (x *MapPrx) Type() typ.Type
- func (x *MapPrx) UnmarshalJSON(b []byte) error
- func (x *MapPrx) Value() Val
- func (x *MapPrx) Zero() bool
- type Mut
- type MutReg
- type Null
- type Num
- type NumMut
- func (i *NumMut) As(t typ.Type) (Val, error)
- func (i *NumMut) Assign(p Val) error
- func (i *NumMut) MarshalJSON() ([]byte, error)
- func (i *NumMut) Mut() Mut
- func (*NumMut) New() Mut
- func (i *NumMut) Nil() bool
- func (i *NumMut) Parse(a ast.Ast) error
- func (i *NumMut) Print(p *bfr.P) error
- func (i *NumMut) Ptr() interface{}
- func (i *NumMut) String() string
- func (*NumMut) Type() typ.Type
- func (i *NumMut) Value() Val
- func (i *NumMut) Zero() bool
- type Obj
- func (s *Obj) As(t typ.Type) (Val, error)
- func (s *Obj) Assign(p Val) error
- func (s *Obj) Idx(i int) (Val, error)
- func (s *Obj) IterIdx(it func(int, Val) error) error
- func (s *Obj) IterKey(it func(string, Val) error) error
- func (s *Obj) Key(k string) (Val, error)
- func (s *Obj) Keys() []string
- func (s *Obj) Len() int
- func (s *Obj) MarshalJSON() ([]byte, error)
- func (s *Obj) Mut() Mut
- func (s *Obj) New() Mut
- func (s *Obj) Nil() bool
- func (s *Obj) Parse(a ast.Ast) error
- func (s *Obj) Print(p *bfr.P) error
- func (s *Obj) Ptr() interface{}
- func (s *Obj) SetIdx(idx int, el Val) error
- func (s *Obj) SetKey(k string, el Val) error
- func (s *Obj) String() string
- func (s *Obj) Type() typ.Type
- func (s *Obj) UnmarshalJSON(b []byte) error
- func (s *Obj) Value() Val
- func (s *Obj) Zero() bool
- type ObjPrx
- func (x *ObjPrx) As(t typ.Type) (Val, error)
- func (x *ObjPrx) Assign(v Val) (err error)
- func (x *ObjPrx) Idx(i int) (Val, error)
- func (x *ObjPrx) IterIdx(it func(int, Val) error) error
- func (x *ObjPrx) IterKey(it func(string, Val) error) error
- func (x *ObjPrx) Key(k string) (Val, error)
- func (x *ObjPrx) Keys() []string
- func (x *ObjPrx) Len() int
- func (x *ObjPrx) MarshalJSON() ([]byte, error)
- func (x *ObjPrx) Mut() Mut
- func (x *ObjPrx) New() Mut
- func (x *ObjPrx) NewWith(v reflect.Value) Mut
- func (x *ObjPrx) Nil() bool
- func (x *ObjPrx) Parse(a ast.Ast) error
- func (x *ObjPrx) Print(p *bfr.P) error
- func (x *ObjPrx) Ptr() interface{}
- func (x *ObjPrx) Reflect() reflect.Value
- func (x *ObjPrx) SetIdx(i int, v Val) error
- func (x *ObjPrx) SetKey(k string, v Val) error
- func (x *ObjPrx) String() string
- func (x *ObjPrx) Type() typ.Type
- func (x *ObjPrx) UnmarshalJSON(b []byte) error
- func (x *ObjPrx) Value() Val
- func (x *ObjPrx) Zero() bool
- type Ops
- type OptPrx
- func (o *OptPrx) As(t typ.Type) (Val, error)
- func (o *OptPrx) Assign(v Val) error
- func (o *OptPrx) MarshalJSON() ([]byte, error)
- func (o *OptPrx) Mut() Mut
- func (o *OptPrx) New() Mut
- func (o *OptPrx) Nil() bool
- func (o *OptPrx) Parse(a ast.Ast) error
- func (o *OptPrx) Print(p *bfr.P) error
- func (o *OptPrx) String() string
- func (o *OptPrx) Type() typ.Type
- func (o *OptPrx) UnmarshalJSON(b []byte) error
- func (o *OptPrx) Unwrap() Val
- func (o *OptPrx) Value() Val
- func (o *OptPrx) Zero() bool
- type Prx
- type PrxReg
- type Raw
- func (r Raw) As(t typ.Type) (Val, error)
- func (r Raw) Len() int
- func (r Raw) MarshalJSON() ([]byte, error)
- func (r Raw) Mut() Mut
- func (r Raw) Nil() bool
- func (r Raw) Print(p *bfr.P) error
- func (r Raw) String() string
- func (Raw) Type() typ.Type
- func (r *Raw) UnmarshalJSON(b []byte) error
- func (r Raw) Value() Val
- func (r Raw) Zero() bool
- type RawMut
- func (r *RawMut) As(t typ.Type) (Val, error)
- func (r *RawMut) Assign(p Val) error
- func (r *RawMut) Len() int
- func (r *RawMut) MarshalJSON() ([]byte, error)
- func (r *RawMut) Mut() Mut
- func (*RawMut) New() Mut
- func (r *RawMut) Nil() bool
- func (r *RawMut) Parse(a ast.Ast) error
- func (r *RawMut) Print(p *bfr.P) error
- func (r *RawMut) Ptr() interface{}
- func (r *RawMut) String() string
- func (*RawMut) Type() typ.Type
- func (r *RawMut) UnmarshalJSON(b []byte) error
- func (r *RawMut) Value() Val
- func (r *RawMut) Zero() bool
- type RawOp
- type RawOps
- type Real
- type RealMut
- func (r *RealMut) As(t typ.Type) (Val, error)
- func (r *RealMut) Assign(p Val) error
- func (r *RealMut) MarshalJSON() ([]byte, error)
- func (r *RealMut) Mut() Mut
- func (*RealMut) New() Mut
- func (r *RealMut) Nil() bool
- func (r *RealMut) Parse(a ast.Ast) error
- func (r *RealMut) Print(p *bfr.P) error
- func (r *RealMut) Ptr() interface{}
- func (r *RealMut) String() string
- func (*RealMut) Type() typ.Type
- func (r *RealMut) Value() Val
- func (r *RealMut) Zero() bool
- type RealPrx
- func (x *RealPrx) As(t typ.Type) (Val, error)
- func (x *RealPrx) Assign(v Val) error
- func (x *RealPrx) MarshalJSON() ([]byte, error)
- func (x *RealPrx) Mut() Mut
- func (x *RealPrx) New() Mut
- func (x *RealPrx) NewWith(v reflect.Value) Mut
- func (x *RealPrx) Nil() bool
- func (x *RealPrx) Parse(a ast.Ast) error
- func (x *RealPrx) Print(p *bfr.P) error
- func (x *RealPrx) Ptr() interface{}
- func (x *RealPrx) Reflect() reflect.Value
- func (x *RealPrx) String() string
- func (x *RealPrx) Type() typ.Type
- func (x *RealPrx) UnmarshalJSON(b []byte) error
- func (x *RealPrx) Value() Val
- func (x *RealPrx) Zero() bool
- type Reg
- type Regs
- type Span
- func (s Span) As(t typ.Type) (Val, error)
- func (s Span) MarshalJSON() ([]byte, error)
- func (s Span) Mut() Mut
- func (s Span) Nil() bool
- func (s Span) Print(p *bfr.P) error
- func (s Span) Seconds() float64
- func (s Span) String() string
- func (Span) Type() typ.Type
- func (s *Span) UnmarshalJSON(b []byte) error
- func (s Span) Value() Val
- func (s Span) Zero() bool
- type SpanMut
- func (s *SpanMut) As(t typ.Type) (Val, error)
- func (s *SpanMut) Assign(p Val) error
- func (s *SpanMut) MarshalJSON() ([]byte, error)
- func (s *SpanMut) Mut() Mut
- func (*SpanMut) New() Mut
- func (s *SpanMut) Nil() bool
- func (s *SpanMut) Parse(a ast.Ast) error
- func (s *SpanMut) Print(p *bfr.P) error
- func (s *SpanMut) Ptr() interface{}
- func (s *SpanMut) String() string
- func (*SpanMut) Type() typ.Type
- func (s *SpanMut) UnmarshalJSON(b []byte) error
- func (s *SpanMut) Value() Val
- func (s *SpanMut) Zero() bool
- type Str
- type StrMut
- func (s *StrMut) As(t typ.Type) (Val, error)
- func (s *StrMut) Assign(p Val) error
- func (s *StrMut) Len() int
- func (s *StrMut) MarshalJSON() ([]byte, error)
- func (s *StrMut) Mut() Mut
- func (*StrMut) New() Mut
- func (s *StrMut) Nil() bool
- func (s *StrMut) Parse(a ast.Ast) error
- func (s *StrMut) Print(p *bfr.P) error
- func (s *StrMut) Ptr() interface{}
- func (s *StrMut) String() string
- func (*StrMut) Type() typ.Type
- func (s *StrMut) Value() Val
- func (s *StrMut) Zero() bool
- type StrOp
- type StrOps
- type Time
- func (t Time) After(o Time) bool
- func (t Time) As(n typ.Type) (Val, error)
- func (t Time) Equal(o Time) bool
- func (t Time) MarshalJSON() ([]byte, error)
- func (t Time) Mut() Mut
- func (t Time) Nil() bool
- func (t Time) Print(p *bfr.P) error
- func (t Time) String() string
- func (Time) Type() typ.Type
- func (t *Time) UnmarshalJSON(b []byte) error
- func (t Time) Value() Val
- func (t Time) Zero() bool
- type TimeMut
- func (t *TimeMut) As(n typ.Type) (Val, error)
- func (t *TimeMut) Assign(p Val) error
- func (t *TimeMut) MarshalJSON() ([]byte, error)
- func (t *TimeMut) Mut() Mut
- func (*TimeMut) New() Mut
- func (t *TimeMut) Nil() bool
- func (t *TimeMut) Parse(a ast.Ast) error
- func (t *TimeMut) Print(p *bfr.P) error
- func (t *TimeMut) Ptr() interface{}
- func (t *TimeMut) String() string
- func (*TimeMut) Type() typ.Type
- func (t *TimeMut) UnmarshalJSON(b []byte) error
- func (t *TimeMut) Value() Val
- func (t *TimeMut) Zero() bool
- type UUID
- func (u UUID) As(t typ.Type) (Val, error)
- func (u UUID) MarshalJSON() ([]byte, error)
- func (u UUID) Mut() Mut
- func (u UUID) Nil() bool
- func (u UUID) Print(p *bfr.P) error
- func (u UUID) String() string
- func (UUID) Type() typ.Type
- func (u *UUID) UnmarshalJSON(b []byte) error
- func (u UUID) Value() Val
- func (u UUID) Zero() bool
- type UUIDMut
- func (u *UUIDMut) As(t typ.Type) (Val, error)
- func (u *UUIDMut) Assign(p Val) error
- func (u *UUIDMut) MarshalJSON() ([]byte, error)
- func (u *UUIDMut) Mut() Mut
- func (*UUIDMut) New() Mut
- func (u *UUIDMut) Nil() bool
- func (u *UUIDMut) Parse(a ast.Ast) error
- func (u *UUIDMut) Print(p *bfr.P) error
- func (u *UUIDMut) Ptr() interface{}
- func (u *UUIDMut) String() string
- func (*UUIDMut) Type() typ.Type
- func (u *UUIDMut) UnmarshalJSON(b []byte) error
- func (u *UUIDMut) Value() Val
- func (u *UUIDMut) Zero() bool
- type Val
- func Clone(v Val) (Val, error)
- func Edit(v Val, f EditFunc) (r Val, err error)
- func EditTypes(v Val, f typ.EditFunc) (Val, error)
- func Parse(str string) (Val, error)
- func ParseVal(a ast.Ast) (v Val, err error)
- func Read(r io.Reader, name string) (Val, error)
- func Select(val Val, path string) (Val, error)
- func SelectIdx(val Val, idx int) (res Val, err error)
- func SelectKey(val Val, key string) (Val, error)
- func SelectPath(val Val, path cor.Path) (_ Val, err error)
- func Unwrap(v Val) Val
- type Vals
- func (v *Vals) Append(n ...Val) error
- func (v *Vals) As(t typ.Type) (Val, error)
- func (v *Vals) Assign(p Val) error
- func (v Vals) Idx(i int) (res Val, err error)
- func (v Vals) IterIdx(it func(int, Val) error) error
- func (v Vals) Len() int
- func (v Vals) MarshalJSON() ([]byte, error)
- func (v *Vals) Mut() Mut
- func (*Vals) New() Mut
- func (v *Vals) Nil() bool
- func (v *Vals) Parse(a ast.Ast) (err error)
- func (v Vals) Print(p *bfr.P) (err error)
- func (v *Vals) Ptr() interface{}
- func (v *Vals) SetIdx(i int, el Val) (err error)
- func (v Vals) String() string
- func (v Vals) Type() typ.Type
- func (v *Vals) UnmarshalJSON(b []byte) error
- func (v *Vals) Value() Val
- func (v *Vals) Zero() bool
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
var ( ErrIdxNotFound = fmt.Errorf("idx not found") ErrKeyNotFound = fmt.Errorf("key not found") ErrAssign = typ.ErrAssign ErrIdxBounds = typ.ErrIdxBounds )
var BreakIter = fmt.Errorf("break iter")
BreakIter is a special error value that can be returned from iterators. It indicates that the iteration should be stopped even though no actual failure occurred.
var SkipCont = errors.New("skip contained values")
SkipCont can be returned from EditFunc to skip over the contained values.
Functions ¶
func AssignPath ¶
AssignPath sets an element of root at path to val or returns an error. It fails on missing intermediate container values.
func Equal ¶
Equal returns whether two literal values are structurally equal. Value types and implementations are not compared.
func UpdateRegs ¶
func UpdateRegs(rs, o *Regs)
Update updates the registry and reflect cache with entries from o.
Types ¶
type AnyPrx ¶
type AnyPrx struct {
// contains filtered or unexported fields
}
AnyPrx proxies to an interface value and manage a literal that represents that interface value.
func (*AnyPrx) MarshalJSON ¶
func (*AnyPrx) UnmarshalJSON ¶
type Delta ¶
type Delta Keyed
Delta is a list of path edits that describe a transformation from one value to another. Each element has an edit key and value. The key describes the edit path and the kind of edit. Special chars are path separators and dollar './$' in the whole path '+*-' in the suffix. If the key contains a dollar sign as segment, the edit value is a list of segment values before the any edit data. The minus suffix means we want to delete a dict key. One star or plus suffix means we have either a nested delta if the edit data is a keyr or list ops if the edit data is a list. If the first star or plus is followed by a star again, then it is a delta ops edit data.
type Idxr ¶
type Idxr interface { Mut Len() int // Idx returns the literal of the element at idx or an error. Idx(idx int) (Val, error) // SetIdx sets the element value at idx to v and returns the indexer or an error. SetIdx(idx int, v Val) error // IterIdx iterates over elements, calling iter with the elements index and value. // If iter returns an error the iteration is aborted. IterIdx(iter func(int, Val) error) error }
Idxr is the interface for indexer values.
type IntPrx ¶
type IntPrx struct {
// contains filtered or unexported fields
}
func (*IntPrx) MarshalJSON ¶
func (*IntPrx) UnmarshalJSON ¶
type Keyr ¶
type Keyr interface { Mut Len() int // Keys returns a string slice of all keys. Keys() []string // Key returns the value of the element with key or an error. Key(key string) (Val, error) // SetKey sets the elements value with key to v and returns the keyer or an error. SetKey(key string, v Val) error // IterKey iterates over elements, calling iter with the elements key and value. // If iter returns an error the iteration is aborted. IterKey(iter func(string, Val) error) error }
Keyr is the interface for keyer values.
type ListOp ¶
ListOp represents a list operation used for list diff edits. N > 0 means retain N elements and N < 0 means delete -N elements and N == 0 means insert V.
type ListPrx ¶
type ListPrx struct {
// contains filtered or unexported fields
}
func (*ListPrx) MarshalJSON ¶
func (*ListPrx) UnmarshalJSON ¶
type MapPrx ¶
type MapPrx struct {
// contains filtered or unexported fields
}
func (*MapPrx) MarshalJSON ¶
func (*MapPrx) UnmarshalJSON ¶
type Mut ¶
Mut is the common interface of all mutable literal values. Mutable values should have an UnmarshalJSON method unless the base type is natively supported.
func CreatePath ¶
CreatePath creates an element of root at path to val or returns an error. It resizes and creates missing intermediate container values using the registry.
func ParseMut ¶
ParseMut parses a as mutable value and returns it or an error. If the null symbol is parsed nil mutable is returned.
type MutReg ¶
MutReg stores a map of custom mutable implementations by reference.
type ObjPrx ¶
type ObjPrx struct {
// contains filtered or unexported fields
}
func (*ObjPrx) MarshalJSON ¶
func (*ObjPrx) UnmarshalJSON ¶
type OptPrx ¶
OptPrx convers a corner case using primary mutable values to null pointers. If we proxy (*bool)(nil) we provide a wrapped *Bool as mutable and keep nil for null values. This narrow usecase lets us asume we have always a value backing value and ptr.
func (*OptPrx) MarshalJSON ¶
func (*OptPrx) UnmarshalJSON ¶
type Prx ¶
type Prx interface { Mut // Reflect returns the reflect value pointed to by this proxy. Reflect() reflect.Value // NewWith returns a new proxy instance with ptr as value. // This method is used internally for proxy caching and should only be called with pointer // values known to be compatible with this proxy implementation. NewWith(ptr reflect.Value) Mut }
Prx is the interface for all reflection based mutable values.
type PrxReg ¶
PrxReg holds process-shared reflection and proxy information
func (*PrxReg) ProxyValue ¶
ProxyValue returns a proxy value for the reflect value ptr or an error.
type RawOp ¶
RawOp represents a string operation used for raw diff edits. N > 0 means retain N bytes and N < 0 means delete -N bytes and N == 0 means insert V.
type RealPrx ¶
type RealPrx struct {
// contains filtered or unexported fields
}
func (*RealPrx) MarshalJSON ¶
func (*RealPrx) UnmarshalJSON ¶
type Reg ¶
type Reg interface { Reflect(rt reflect.Type) (typ.Type, error) ProxyValue(ptr reflect.Value) (Mut, error) }
Reg is a registry interface for a reflection and proxy cache
type Regs ¶
Regs embeds both PrxReg and MutReg to make it easier to provide and pass around. It implements the Reg interface by embedding PrxReg.
func DefaultRegs ¶
Default applies sensible defaults to rs and returns it.
type StrOp ¶
StrOp represents a string operation used for str diff edits. N > 0 means retain N runes and N < 0 means delete -N runes and N == 0 means insert V.
type Val ¶
Val is the common interface of all literal values.
func Clone ¶
Clone deep copies v or returns an error. It uses the same value implementations, but may turn none-mutable primitive values into a mutable representation.
func SelectPath ¶
SelectPath returns the selected value at path from val or an error.