lib

package
v0.4.1-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultUrl = nats.DefaultURL
View Source
const NodeNamePrefix = "marmot-node"

Variables

View Source
var EntryReplicas = int(0)
View Source
var MaxLogEntries = int64(1024)
View Source
var StreamNamePrefix = "marmot-changes"
View Source
var SubjectPrefix = "marmot-change-log"

Functions

This section is empty.

Types

type ReplicationEvent

type ReplicationEvent[T any] struct {
	FromNodeId  uint64
	ChangeRowId int64
	Payload     *T
}

func (*ReplicationEvent[T]) Marshal

func (e *ReplicationEvent[T]) Marshal() ([]byte, error)

func (*ReplicationEvent[T]) Unmarshal

func (e *ReplicationEvent[T]) Unmarshal(data []byte) error

type Replicator added in v0.4.1

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

func NewReplicator added in v0.4.1

func NewReplicator(nodeID uint64, natsServer string, shards uint64) (*Replicator, error)

func (*Replicator) Listen added in v0.4.1

func (r *Replicator) Listen(shardID uint64, callback func(payload []byte) error) error

func (*Replicator) Publish added in v0.4.1

func (r *Replicator) Publish(hash uint64, payload []byte) error

Jump to

Keyboard shortcuts

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