Documentation ¶
Index ¶
- Variables
- type Add
- type Edit
- func (e *Edit) Content() string
- func (e *Edit) CreatedAtMapByActor() map[string]*time.Ticket
- func (e *Edit) Execute(root *json.Root) error
- func (e *Edit) ExecutedAt() *time.Ticket
- func (e *Edit) From() *json.RGATreeSplitNodePos
- func (e *Edit) ParentCreatedAt() *time.Ticket
- func (e *Edit) SetActor(actorID *time.ActorID)
- func (e *Edit) To() *json.RGATreeSplitNodePos
- type Increase
- type Move
- type Operation
- type Remove
- type RichEdit
- func (e *RichEdit) Attributes() map[string]string
- func (e *RichEdit) Content() string
- func (e *RichEdit) CreatedAtMapByActor() map[string]*time.Ticket
- func (e *RichEdit) Execute(root *json.Root) error
- func (e *RichEdit) ExecutedAt() *time.Ticket
- func (e *RichEdit) From() *json.RGATreeSplitNodePos
- func (e *RichEdit) ParentCreatedAt() *time.Ticket
- func (e *RichEdit) SetActor(actorID *time.ActorID)
- func (e *RichEdit) To() *json.RGATreeSplitNodePos
- type Select
- type Set
- type Style
- func (e *Style) Attributes() map[string]string
- func (e *Style) Execute(root *json.Root) error
- func (e *Style) ExecutedAt() *time.Ticket
- func (e *Style) From() *json.RGATreeSplitNodePos
- func (e *Style) ParentCreatedAt() *time.Ticket
- func (e *Style) SetActor(actorID *time.ActorID)
- func (e *Style) To() *json.RGATreeSplitNodePos
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotApplicableDataType occurs when attempting to execute an operation // on a data type that cannot be executed. ErrNotApplicableDataType = errors.New("fail to execute this operation") )
Functions ¶
This section is empty.
Types ¶
type Add ¶
type Add struct {
// contains filtered or unexported fields
}
Add is an operation representing adding an element to an Array.
func NewAdd ¶
func NewAdd( parentCreatedAt *time.Ticket, prevCreatedAt *time.Ticket, value json.Element, executedAt *time.Ticket, ) *Add
NewAdd creates a new instance of Add.
func (*Add) ExecutedAt ¶
ExecutedAt returns execution time of this operation.
func (*Add) ParentCreatedAt ¶
ParentCreatedAt returns the creation time of the Array.
func (*Add) PrevCreatedAt ¶
PrevCreatedAt returns the creation time of previous element.
type Edit ¶
type Edit struct {
// contains filtered or unexported fields
}
Edit is an operation representing editing Text.
func NewEdit ¶
func NewEdit( parentCreatedAt *time.Ticket, from *json.RGATreeSplitNodePos, to *json.RGATreeSplitNodePos, latestCreatedAtMapByActor map[string]*time.Ticket, content string, executedAt *time.Ticket, ) *Edit
NewEdit creates a new instance of Edit.
func (*Edit) CreatedAtMapByActor ¶
CreatedAtMapByActor returns the map that stores the latest creation time by actor for the nodes included in the editing range.
func (*Edit) ExecutedAt ¶
ExecutedAt returns execution time of this operation.
func (*Edit) From ¶
func (e *Edit) From() *json.RGATreeSplitNodePos
From returns the start point of the editing range.
func (*Edit) ParentCreatedAt ¶
ParentCreatedAt returns the creation time of the Text.
func (*Edit) To ¶
func (e *Edit) To() *json.RGATreeSplitNodePos
To returns the end point of the editing range.
type Increase ¶
type Increase struct {
// contains filtered or unexported fields
}
Increase represents an operation that increments a numeric value to Counter. Among Primitives, numeric types Integer, Long, and Double are used as values.
func NewIncrease ¶
func NewIncrease( parentCreatedAt *time.Ticket, value json.Element, executedAt *time.Ticket, ) *Increase
NewIncrease creates the increase instance.
func (*Increase) ExecutedAt ¶
ExecutedAt returns execution time of this operation.
func (*Increase) ParentCreatedAt ¶
ParentCreatedAt returns the creation time of Counter.
type Move ¶
type Move struct {
// contains filtered or unexported fields
}
Move is an operation representing moving an element to an Array.
func NewMove ¶
func NewMove( parentCreatedAt *time.Ticket, prevCreatedAt *time.Ticket, createdAt *time.Ticket, executedAt *time.Ticket, ) *Move
NewMove creates a new instance of Move.
func (*Move) ExecutedAt ¶
ExecutedAt returns execution time of this operation.
func (*Move) ParentCreatedAt ¶
ParentCreatedAt returns the creation time of the Array.
func (*Move) PrevCreatedAt ¶
PrevCreatedAt returns the creation time of previous element.
type Operation ¶
type Operation interface { // Execute executes this operation on the given document(`root`). Execute(root *json.Root) error // ExecutedAt returns execution time of this operation. ExecutedAt() *time.Ticket // SetActor sets the given actor to this operation. SetActor(id *time.ActorID) // ParentCreatedAt returns the creation time of the target element to // execute the operation. ParentCreatedAt() *time.Ticket }
Operation represents an operation to be executed on a document.
type Remove ¶
type Remove struct {
// contains filtered or unexported fields
}
Remove is an operation representing removes an element from Container.
func NewRemove ¶
func NewRemove( parentCreatedAt *time.Ticket, createdAt *time.Ticket, executedAt *time.Ticket, ) *Remove
NewRemove creates a new instance of Remove.
func (*Remove) ExecutedAt ¶
ExecutedAt returns execution time of this operation.
func (*Remove) ParentCreatedAt ¶
ParentCreatedAt returns the creation time of the Container.
type RichEdit ¶
type RichEdit struct {
// contains filtered or unexported fields
}
RichEdit is an operation representing editing RichText. Most of the same as Edit, but with additional style properties, attributes.
func NewRichEdit ¶
func NewRichEdit( parentCreatedAt *time.Ticket, from *json.RGATreeSplitNodePos, to *json.RGATreeSplitNodePos, latestCreatedAtMapByActor map[string]*time.Ticket, content string, attributes map[string]string, executedAt *time.Ticket, ) *RichEdit
NewRichEdit creates a new instance of RichEdit.
func (*RichEdit) Attributes ¶
Attributes returns the attributes of this Edit.
func (*RichEdit) CreatedAtMapByActor ¶
CreatedAtMapByActor returns the map that stores the latest creation time by actor for the nodes included in the editing range.
func (*RichEdit) ExecutedAt ¶
ExecutedAt returns execution time of this operation.
func (*RichEdit) From ¶
func (e *RichEdit) From() *json.RGATreeSplitNodePos
From returns the start point of the editing range.
func (*RichEdit) ParentCreatedAt ¶
ParentCreatedAt returns the creation time of the RichText.
func (*RichEdit) To ¶
func (e *RichEdit) To() *json.RGATreeSplitNodePos
To returns the end point of the editing range.
type Select ¶
type Select struct {
// contains filtered or unexported fields
}
Select represents an operation that selects an area in the text.
func NewSelect ¶
func NewSelect( parentCreatedAt *time.Ticket, from *json.RGATreeSplitNodePos, to *json.RGATreeSplitNodePos, executedAt *time.Ticket, ) *Select
NewSelect creates a new instance of Select.
func (*Select) ExecutedAt ¶
ExecutedAt returns execution time of this operation.
func (*Select) From ¶
func (s *Select) From() *json.RGATreeSplitNodePos
From returns the start point of the selection.
func (*Select) ParentCreatedAt ¶
ParentCreatedAt returns the creation time of the Text.
func (*Select) To ¶
func (s *Select) To() *json.RGATreeSplitNodePos
To returns the end point of the selection.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set represents an operation that stores the value corresponding to the given key in the Object.
func NewSet ¶
func NewSet( parentCreatedAt *time.Ticket, key string, value json.Element, executedAt *time.Ticket, ) *Set
NewSet creates a new instance of Set.
func (*Set) ExecutedAt ¶
ExecutedAt returns execution time of this operation.
func (*Set) ParentCreatedAt ¶
ParentCreatedAt returns the creation time of the Object.
type Style ¶
type Style struct {
// contains filtered or unexported fields
}
Style is an operation applies the style of the given range to RichText.
func NewStyle ¶
func NewStyle( parentCreatedAt *time.Ticket, from *json.RGATreeSplitNodePos, to *json.RGATreeSplitNodePos, attributes map[string]string, executedAt *time.Ticket, ) *Style
NewStyle creates a new instance of Style.
func (*Style) Attributes ¶
Attributes returns the attributes of this operation.
func (*Style) ExecutedAt ¶
ExecutedAt returns execution time of this operation.
func (*Style) From ¶
func (e *Style) From() *json.RGATreeSplitNodePos
From returns the start point of the editing range.
func (*Style) ParentCreatedAt ¶
ParentCreatedAt returns the creation time of the RichText.
func (*Style) To ¶
func (e *Style) To() *json.RGATreeSplitNodePos
To returns the end point of the editing range.