Documentation
¶
Index ¶
- func Put(objOrArr ObjOrArr, ptr Ptr, value Value) error
- func Unescape(str PtrToken) string
- type Arr
- func (a *Arr) Append(v ...Value) *Arr
- func (a *Arr) Bool() bool
- func (a *Arr) Float64() float64
- func (a *Arr) Get(idx int) Value
- func (a *Arr) Len() int
- func (a *Arr) MarshalJSON() ([]byte, error)
- func (a *Arr) SetAt(idx int, v Value)
- func (a *Arr) String() string
- func (a *Arr) UnmarshalJSON(bytes []byte) error
- type Bool
- type Null
- type Number
- type Obj
- func (o *Obj) All() iter.Seq2[string, Value]
- func (o *Obj) Bool() bool
- func (o *Obj) Float64() float64
- func (o *Obj) Get(k string) (Value, bool)
- func (o *Obj) GetOr(k string, defaultValue Value) Value
- func (o *Obj) Keys() []string
- func (o *Obj) Len() int
- func (o *Obj) MarshalJSON() ([]byte, error)
- func (o *Obj) Put(k string, v Value)
- func (o *Obj) String() string
- func (o *Obj) UnmarshalJSON(bytes []byte) error
- type ObjOrArr
- type Primitive
- type Ptr
- type PtrToken
- type String
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Put ¶ added in v0.0.4
Put tries to resolve the given pointer to put the given value. If ptr addresses an array, an index of -1 will just append the value. Otherwise, the array is filled up with nil values. Note that any key which looks like an integer is considered to be an array index and not an object key.
Types ¶
type Arr ¶ added in v0.0.4
type Arr struct {
// contains filtered or unexported fields
}
func (*Arr) MarshalJSON ¶ added in v0.0.4
func (*Arr) UnmarshalJSON ¶ added in v0.0.4
type Null ¶ added in v0.0.4
type Null struct {
}
func (Null) MarshalJSON ¶ added in v0.0.4
func (Null) UnmarshalJSON ¶ added in v0.0.4
type Obj ¶ added in v0.0.4
type Obj struct {
// contains filtered or unexported fields
}
func (*Obj) MarshalJSON ¶ added in v0.0.6
func (*Obj) UnmarshalJSON ¶ added in v0.0.4
type ObjOrArr ¶ added in v0.0.4
type ObjOrArr interface {
Value
// contains filtered or unexported methods
}
type Primitive ¶ added in v0.0.4
type Primitive interface {
// contains filtered or unexported methods
}
type Ptr ¶ added in v0.0.4
type Ptr = string
A Ptr specifies a specific value within a JSON document. See https://tools.ietf.org/html/rfc6901 for the specification.
type PtrToken ¶ added in v0.0.4
type PtrToken = string
A PtrToken is a single element or token of a Ptr
type Value ¶ added in v0.0.4
type Value interface {
String() string
Bool() bool
Float64() float64
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.