Documentation ¶
Index ¶
- Constants
- Variables
- func IsDelete(op *Op) bool
- func IsInsert(op *Op) bool
- func IsRetain(op *Op) bool
- func OperationTransform(a, b *Operation) (*Operation, *Operation, error)
- type Client
- type Op
- type Operation
- func (t *Operation) Apply(s string) (string, error)
- func (t *Operation) At(i int) *Op
- func (t *Operation) Delete(n int) *Operation
- func (t *Operation) Insert(s string) *Operation
- func (t *Operation) LastOp() *Op
- func (t *Operation) Marshal() []interface{}
- func (t *Operation) Retain(n int) *Operation
- type Range
- type Selection
- type Session
- type TextEncodingType
Constants ¶
View Source
const ( TextEncodingTypeUTF8 = iota TextEncodingTypeUTF16 )
Variables ¶
View Source
var ( ErrOperationBaseLenMismatch = errors.New("ot/operation: base length mismatch") ErrOperationTransformFailed = errors.New("ot/operation: transform failed") ErrOperationMarshalFailed = errors.New("ot/operation: marshal failed") ErrOpeartionUnmarshalFailed = errors.New("ot/operation: unmarshal failed") )
View Source
var (
ErrInvalidRevision = errors.New("ot/session: invalid revision")
)
View Source
var (
ErrSelecttionUnmarshalFailed = errors.New("ot/selection: unmarshal failed")
)
View Source
var TextEncoding = TextEncodingTypeUTF8
use utf-8 by default
Functions ¶
Types ¶
type Selection ¶
type Selection struct {
Ranges []Range `json:"ranges"`
}
the selection range
func SelectionUnmarshal ¶
func (*Selection) SelectionMarshal ¶
type Session ¶
func NewSession ¶
func (*Session) AddOperation ¶
func (*Session) RemoveClient ¶
func (*Session) SetSelection ¶
type TextEncodingType ¶
type TextEncodingType int
Click to show internal directories.
Click to hide internal directories.