syncstatus

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatusProvider

type StatusProvider interface {
	StatusUpdater
	StatusWatcher
}

func NewSyncStatusProvider

func NewSyncStatusProvider(spaceId string, deps SyncStatusDeps) StatusProvider

type StatusUpdater

type StatusUpdater interface {
	HeadsChange(treeId string, heads []string)
	HeadsReceive(senderId, treeId string, heads []string)

	SetNodesOnline(senderId string, online bool)
	StateCounter() uint64
	RemoveAllExcept(senderId string, differentRemoteIds []string, stateCounter uint64)

	Run()
	Close() error
}

func NewNoOpSyncStatus

func NewNoOpSyncStatus() StatusUpdater

type StatusWatcher

type StatusWatcher interface {
	Watch(treeId string) (err error)
	Unwatch(treeId string)
	SetUpdateReceiver(updater UpdateReceiver)
}

type SyncStatus

type SyncStatus int
const (
	StatusUnknown SyncStatus = iota
	StatusSynced
	StatusNotSynced
)

type SyncStatusDeps

type SyncStatusDeps struct {
	UpdateIntervalSecs int
	UpdateTimeout      time.Duration
	Configuration      nodeconf.NodeConf
	Storage            spacestorage.SpaceStorage
}

func DefaultDeps

func DefaultDeps(configuration nodeconf.NodeConf, store spacestorage.SpaceStorage) SyncStatusDeps

type UpdateReceiver

type UpdateReceiver interface {
	UpdateTree(ctx context.Context, treeId string, status SyncStatus) (err error)
	UpdateNodeConnection(online bool)
}

Jump to

Keyboard shortcuts

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