Documentation ¶
Overview ¶
Package json provides the JSON document implementation.
Index ¶
- type Array
- func (p *Array) AddBool(values ...bool) *Array
- func (p *Array) AddBytes(values ...[]byte) *Array
- func (p *Array) AddDate(values ...gotime.Time) *Array
- func (p *Array) AddDouble(values ...float64) *Array
- func (p *Array) AddInteger(values ...int) *Array
- func (p *Array) AddLong(values ...int64) *Array
- func (p *Array) AddNewArray() *Array
- func (p *Array) AddNull() *Array
- func (p *Array) AddString(values ...string) *Array
- func (p *Array) Delete(idx int) crdt.Element
- func (p *Array) InsertIntegerAfter(index int, v int) *Array
- func (p *Array) Len() int
- func (p *Array) MoveBefore(nextCreatedAt, createdAt *time.Ticket)
- type Counter
- type Object
- func (p *Object) Delete(k string) crdt.Element
- func (p *Object) GetArray(k string) *Array
- func (p *Object) GetCounter(k string) *Counter
- func (p *Object) GetObject(k string) *Object
- func (p *Object) GetText(k string) *Text
- func (p *Object) SetBool(k string, v bool) *Object
- func (p *Object) SetBytes(k string, v []byte) *Object
- func (p *Object) SetDate(k string, v gotime.Time) *Object
- func (p *Object) SetDouble(k string, v float64) *Object
- func (p *Object) SetInteger(k string, v int) *Object
- func (p *Object) SetLong(k string, v int64) *Object
- func (p *Object) SetNewArray(k string) *Array
- func (p *Object) SetNewCounter(k string, t crdt.CounterType, n interface{}) *Counter
- func (p *Object) SetNewObject(k string) *Object
- func (p *Object) SetNewText(k string) *Text
- func (p *Object) SetNull(k string) *Object
- func (p *Object) SetString(k, v string) *Object
- type Text
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
Array represents an array in the document. As a proxy for the CRDT array, it is used when the user manipulate the array from the outside.
func (*Array) AddInteger ¶ added in v0.2.16
AddInteger adds the given integer at the last.
func (*Array) AddNewArray ¶ added in v0.2.16
AddNewArray adds a new array at the last.
func (*Array) InsertIntegerAfter ¶ added in v0.2.16
InsertIntegerAfter inserts the given integer after the given previous element.
func (*Array) MoveBefore ¶ added in v0.2.16
MoveBefore moves the given element to its new position before the given next element.
type Counter ¶
Counter represents a counter in the document. As a proxy for the CRDT counter, it is used when the user manipulates the counter from the outside.
func NewCounter ¶
NewCounter create Counter instance.
type Object ¶
Object represents an object in the document. As a proxy for the CRDT object, it is used when the user manipulates the object from the outside.
func (*Object) GetCounter ¶ added in v0.2.16
GetCounter returns Counter of the given key.
func (*Object) SetInteger ¶ added in v0.2.16
SetInteger sets the given integer for the given key.
func (*Object) SetNewArray ¶ added in v0.2.16
SetNewArray sets a new Array for the given key.
func (*Object) SetNewCounter ¶ added in v0.2.16
func (p *Object) SetNewCounter(k string, t crdt.CounterType, n interface{}) *Counter
SetNewCounter sets a new NewCounter for the given key.
func (*Object) SetNewObject ¶ added in v0.2.16
SetNewObject sets a new Object for the given key.
func (*Object) SetNewText ¶ added in v0.2.16
SetNewText sets a new Text for the given key.
type Text ¶
Text represents a text in the document. As a proxy for the CRDT text, it is used when the user manipulates the rich text from the outside.