Documentation ¶
Overview ¶
replicator is a package managing the replication of data among peers
replicator the replication logic for an OrbitDB store
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventLoadAdded ¶
EventLoadAdded An event triggered when entries have been added
func NewEventLoadAdded ¶
func NewEventLoadAdded(h cid.Cid) *EventLoadAdded
NewEventLoadAdded Creates a new EventLoadAdded event
type EventLoadEnd ¶
EventLoadEnd An event triggered when load ended
func NewEventLoadEnd ¶
func NewEventLoadEnd(logs []ipfslog.Log) *EventLoadEnd
NewEventLoadEnd Creates a new EventLoadEnd event
type EventLoadProgress ¶
EventLoadProgress An event triggered when entries have been loaded
func NewEventLoadProgress ¶
func NewEventLoadProgress(id string, h cid.Cid, latest ipfslog.Entry, bufferLength int) *EventLoadProgress
NewEventLoadProgress Creates a new EventLoadProgress event
type ReplicationInfo ¶
type ReplicationInfo interface { // GetProgress Get the value of progress GetProgress() int // GetMax Get the value of max GetMax() int // GetBuffered Get the value of buffered GetBuffered() int // GetQueued Get the value of queued GetQueued() int // IncQueued Increments the value of queued IncQueued() // Reset Resets all values to 0 Reset() // SetProgress Sets the value of progress SetProgress(i int) // SetMax Sets the value of max SetMax(i int) // DecreaseQueued Decrements the value of queued of i DecreaseQueued(i int) // SetBuffered Sets the value of buffered SetBuffered(i int) }
ReplicationInfo Holds information about the current replication state
func NewReplicationInfo ¶
func NewReplicationInfo() ReplicationInfo
NewReplicationInfo Creates a new ReplicationInfo instance
type Replicator ¶
type Replicator interface { events.EmitterInterface // Stop Stops the replication Stop() // Load Loads new data to replicate Load(ctx context.Context, cids []cid.Cid) // GetQueue Returns the list of CID in the queue GetQueue() []cid.Cid // GetBufferLen Gets the length of the buffer GetBufferLen() int }
Replicator Replicates stores information among peers
func NewReplicator ¶
func NewReplicator(ctx context.Context, store storeInterface, concurrency uint, opts *Options) Replicator
NewReplicator Creates a new Replicator instance