proxy

package
v0.2.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayProxy

type ArrayProxy struct {
	*json.Array
	// contains filtered or unexported fields
}

ArrayProxy is a proxy representing Array.

func NewArrayProxy

func NewArrayProxy(ctx *change.Context, array *json.Array) *ArrayProxy

NewArrayProxy creates a new instance of ArrayProxy.

func (*ArrayProxy) AddBool

func (p *ArrayProxy) AddBool(values ...bool) *ArrayProxy

AddBool adds the given boolean at the last.

func (*ArrayProxy) AddBytes

func (p *ArrayProxy) AddBytes(values ...[]byte) *ArrayProxy

AddBytes adds the given bytes at the last.

func (*ArrayProxy) AddDate

func (p *ArrayProxy) AddDate(values ...gotime.Time) *ArrayProxy

AddDate adds the given date at the last.

func (*ArrayProxy) AddDouble

func (p *ArrayProxy) AddDouble(values ...float64) *ArrayProxy

AddDouble adds the given double at the last.

func (*ArrayProxy) AddInteger

func (p *ArrayProxy) AddInteger(values ...int) *ArrayProxy

AddInteger adds the given integer at the last.

func (*ArrayProxy) AddLong

func (p *ArrayProxy) AddLong(values ...int64) *ArrayProxy

AddLong adds the given long at the last.

func (*ArrayProxy) AddNewArray

func (p *ArrayProxy) AddNewArray() *ArrayProxy

AddNewArray adds a new array at the last.

func (*ArrayProxy) AddNull added in v0.1.3

func (p *ArrayProxy) AddNull() *ArrayProxy

AddNull adds the null at the last.

func (*ArrayProxy) AddString

func (p *ArrayProxy) AddString(values ...string) *ArrayProxy

AddString adds the given string at the last.

func (*ArrayProxy) Delete

func (p *ArrayProxy) Delete(idx int) json.Element

Delete deletes the element of the given index.

func (*ArrayProxy) InsertIntegerAfter

func (p *ArrayProxy) InsertIntegerAfter(index int, v int) *ArrayProxy

InsertIntegerAfter inserts the given integer after the given previous element.

func (*ArrayProxy) Len

func (p *ArrayProxy) Len() int

Len returns length of this Array.

func (*ArrayProxy) MoveBefore

func (p *ArrayProxy) MoveBefore(nextCreatedAt, createdAt *time.Ticket)

MoveBefore moves the given element to its new position before the given next element.

type CounterProxy

type CounterProxy struct {
	*json.Counter
	// contains filtered or unexported fields
}

CounterProxy is a proxy representing counter.

func NewCounterProxy

func NewCounterProxy(ctx *change.Context, counter *json.Counter) *CounterProxy

NewCounterProxy create CounterProxy instance.

func (*CounterProxy) Increase

func (p *CounterProxy) Increase(v interface{}) *CounterProxy

Increase adds an increase operations. Only numeric types are allowed as operand values, excluding uint64 and uintptr.

type ObjectProxy

type ObjectProxy struct {
	*json.Object
	// contains filtered or unexported fields
}

ObjectProxy is a proxy representing Object.

func NewObjectProxy

func NewObjectProxy(ctx *change.Context, root *json.Object) *ObjectProxy

NewObjectProxy creates a new instance of ObjectProxy.

func (*ObjectProxy) Delete

func (p *ObjectProxy) Delete(k string) json.Element

Delete deletes the value of the given key.

func (*ObjectProxy) GetArray

func (p *ObjectProxy) GetArray(k string) *ArrayProxy

GetArray returns Array of the given key.

func (*ObjectProxy) GetCounter

func (p *ObjectProxy) GetCounter(k string) *CounterProxy

GetCounter returns CounterProxy of the given key.

func (*ObjectProxy) GetObject

func (p *ObjectProxy) GetObject(k string) *ObjectProxy

GetObject returns Object of the given key.

func (*ObjectProxy) GetRichText

func (p *ObjectProxy) GetRichText(k string) *RichTextProxy

GetRichText returns RichText of the given key.

func (*ObjectProxy) GetText

func (p *ObjectProxy) GetText(k string) *TextProxy

GetText returns Text of the given key.

func (*ObjectProxy) SetBool

func (p *ObjectProxy) SetBool(k string, v bool) *ObjectProxy

SetBool sets the given boolean for the given key.

func (*ObjectProxy) SetBytes

func (p *ObjectProxy) SetBytes(k string, v []byte) *ObjectProxy

SetBytes sets the given bytes for the given key.

func (*ObjectProxy) SetDate

func (p *ObjectProxy) SetDate(k string, v gotime.Time) *ObjectProxy

SetDate sets the given date for the given key.

func (*ObjectProxy) SetDouble

func (p *ObjectProxy) SetDouble(k string, v float64) *ObjectProxy

SetDouble sets the given double for the given key.

func (*ObjectProxy) SetInteger

func (p *ObjectProxy) SetInteger(k string, v int) *ObjectProxy

SetInteger sets the given integer for the given key.

func (*ObjectProxy) SetLong

func (p *ObjectProxy) SetLong(k string, v int64) *ObjectProxy

SetLong sets the given long for the given key.

func (*ObjectProxy) SetNewArray

func (p *ObjectProxy) SetNewArray(k string) *ArrayProxy

SetNewArray sets a new Array for the given key.

func (*ObjectProxy) SetNewCounter

func (p *ObjectProxy) SetNewCounter(k string, n interface{}) *CounterProxy

SetNewCounter sets a new NewCounter for the given key.

func (*ObjectProxy) SetNewObject

func (p *ObjectProxy) SetNewObject(k string) *ObjectProxy

SetNewObject sets a new Object for the given key.

func (*ObjectProxy) SetNewRichText

func (p *ObjectProxy) SetNewRichText(k string) *RichTextProxy

SetNewRichText sets a new RichText for the given key.

func (*ObjectProxy) SetNewText

func (p *ObjectProxy) SetNewText(k string) *TextProxy

SetNewText sets a new Text for the given key.

func (*ObjectProxy) SetNull added in v0.1.3

func (p *ObjectProxy) SetNull(k string) *ObjectProxy

SetNull sets the null for the given key.

func (*ObjectProxy) SetString

func (p *ObjectProxy) SetString(k, v string) *ObjectProxy

SetString sets the given string for the given key.

type RichTextProxy

type RichTextProxy struct {
	*json.RichText
	// contains filtered or unexported fields
}

RichTextProxy is a proxy representing RichText.

func NewRichTextProxy

func NewRichTextProxy(ctx *change.Context, text *json.RichText) *RichTextProxy

NewRichTextProxy creates a new instance of RichTextProxy.

func (*RichTextProxy) Edit

func (p *RichTextProxy) Edit(from, to int, content string, attributes map[string]string) *RichTextProxy

Edit edits the given range with the given content and attributes.

func (*RichTextProxy) SetStyle

func (p *RichTextProxy) SetStyle(from, to int, attributes map[string]string) *RichTextProxy

SetStyle applies the style of the given range.

type TextProxy

type TextProxy struct {
	*json.Text
	// contains filtered or unexported fields
}

TextProxy is a proxy representing Text.

func NewTextProxy

func NewTextProxy(ctx *change.Context, text *json.Text) *TextProxy

NewTextProxy creates a new instance of TextProxy.

func (*TextProxy) Edit

func (p *TextProxy) Edit(from, to int, content string) *TextProxy

Edit edits the given range with the given content.

func (*TextProxy) Select added in v0.1.1

func (p *TextProxy) Select(from, to int) *TextProxy

Select stores that the given range has been selected.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL