cregister

package
v0.0.0-...-3949d01 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cregister defines CRegister, a simple last-one-wins CRDT value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRegister

type CRegister struct {
	AgentId uint32
	Vec     *common.VersionVector
	Time    time.Time
	Val     interface{}
}

CRegister is a CRDT register (last-one-wins). Fields are exported to support CRegister.Encode.

func Decode

func Decode(s string) (*CRegister, error)

Decode decodes the given value into a CRegister.

func New

func New() *CRegister

New returns a new CRegister.

func (*CRegister) ApplyClientPatch

func (r *CRegister) ApplyClientPatch(agentId uint32, vec *common.VersionVector, t time.Time, patch string) (string, error)

ApplyClientPatch implements CValue.ApplyClientPatch.

func (*CRegister) ApplyServerPatch

func (r *CRegister) ApplyServerPatch(patch string) error

ApplyServerPatch implements CValue.ApplyServerPatch.

func (*CRegister) DType

func (r *CRegister) DType() string

DType implements CValue.DType.

func (*CRegister) Encode

func (r *CRegister) Encode() (string, error)

Encode implements CValue.Encode.

Jump to

Keyboard shortcuts

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