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 ¶
var Events = []interface{}{ new(EventLoadEnd), new(EventLoadAdded), new(EventLoadProgress), }
Functions ¶
This section is empty.
Types ¶
type EventLoadAdded ¶
EventLoadAdded An event triggered when entries have been added
func NewEventLoadAdded ¶
func NewEventLoadAdded(h cid.Cid, entry ipfslog.Entry) 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(entry ipfslog.Entry) EventLoadProgress
NewEventLoadProgress Creates a new EventLoadProgress event
type ReplicationInfo ¶
type ReplicationInfo interface {
// GetProgress Get the value of progress
GetProgress() int
// GetProgress Get the value of progress
SetProgress(i int)
// GetMax Get the value of max
GetMax() int
// SetMax Sets the value of max
SetMax(i int)
// Reset Resets all values to 0
Reset()
}
ReplicationInfo Holds information about the current replication state
func NewReplicationInfo ¶
func NewReplicationInfo() ReplicationInfo
NewReplicationInfo Creates a new ReplicationInfo instance
type Replicator ¶
type Replicator interface {
// Stop Stops the replication
Stop()
// Load Loads new data to replicate
Load(ctx context.Context, heads []ipfslog.Entry)
// GetQueue Returns the list of CID in the queue
GetQueue() []cid.Cid
EventBus() event.Bus
}
Replicator Replicates stores information among peers
func NewReplicator ¶
func NewReplicator(store storeInterface, concurrency uint, opts *Options) (Replicator, error)
NewReplicator Creates a new Replicator instance