oplog

package
v0.0.0-...-60c1ff8 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) Add

func (h *Handler) Add(key string, value []byte, mType string)

func (*Handler) OpLog

func (h *Handler) OpLog(from string) [][]byte

func (*Handler) Remove

func (h *Handler) Remove(key string)

func (*Handler) Replicate

func (h *Handler) Replicate(op *OpLog)

func (*Handler) SetProcessChannel

func (h *Handler) SetProcessChannel(ch chan *OpLog)

func (*Handler) SetReplicaChannel

func (h *Handler) SetReplicaChannel(ch chan *OpLog)

func (*Handler) SetReplicator

func (h *Handler) SetReplicator(rep Replicator)

func (*Handler) Start

func (h *Handler) Start(db *db.DB)

func (*Handler) Stop

func (h *Handler) Stop()

type InAppReplicator

type InAppReplicator struct {
	Buffer chan *OpLog
}

func (*InAppReplicator) Send

func (r *InAppReplicator) Send(op *OpLog) error

type OpLog

type OpLog struct {
	ID           string        // Operation ID, sortable
	KID          string        // The actual ID that is written Buffer the DB on ADD
	Key          string        // The key used in the interface
	Op           Opn           // The operation (Add, remove etc.
	Value        *crdt.TSValue // What Buffer store
	IsFromRemote bool
}

func NewOp

func NewOp(key string, value []byte, opn Opn, mType string) *OpLog

type Opn

type Opn string
const (
	ADD Opn = "ADD"
	REM Opn = "REM"
)

type PeeringReplicator

type PeeringReplicator struct {
	Queue *memberlist.TransmitLimitedQueue
}

func (*PeeringReplicator) Send

func (r *PeeringReplicator) Send(op *OpLog) error

type Replicator

type Replicator interface {
	Send(op *OpLog) error
}

Jump to

Keyboard shortcuts

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