syncstatus

package
v0.3.32 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CName = "common.commonspace.syncstatus"

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionStatus added in v0.3.0

type ConnectionStatus int
const (
	Online ConnectionStatus = iota
	ConnectionError
	RemovedFromNetwork
)

type StatusService added in v0.2.0

type StatusService interface {
	app.ComponentRunnable
	StatusUpdater
	StatusWatcher
}

func NewNoOpSyncStatus

func NewNoOpSyncStatus() StatusService

func NewSyncStatusProvider

func NewSyncStatusProvider() StatusService

type StatusServiceProvider added in v0.2.0

type StatusServiceProvider interface {
	app.Component
	NewStatusService() StatusService
}

type StatusUpdater

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

	SetNodesStatus(senderId string, status ConnectionStatus)
	StateCounter() uint64
	RemoveAllExcept(senderId string, differentRemoteIds []string, stateCounter uint64)
}

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 UpdateReceiver

type UpdateReceiver interface {
	UpdateTree(ctx context.Context, treeId string, status SyncStatus) (err error)
	UpdateNodeStatus(status ConnectionStatus)
}

Jump to

Keyboard shortcuts

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