objectsync

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshallTreeMessage

func MarshallTreeMessage(message *treechangeproto.TreeSyncMessage, spaceId, objectId, replyId string) (objMsg *spacesyncproto.ObjectSyncMessage, err error)

Types

type LastUsage

type LastUsage interface {
	LastUsage() time.Time
}

type MessageHandler

type MessageHandler func(ctx context.Context, senderId string, message *spacesyncproto.ObjectSyncMessage) (err error)

type MessagePool

MessagePool can be made generic to work with different streams

type ObjectSync

type ObjectSync interface {
	LastUsage
	synchandler.SyncHandler
	SyncClient() SyncClient

	Close() (err error)
}

func NewObjectSync

func NewObjectSync(
	spaceId string,
	spaceIsDeleted *atomic.Bool,
	configuration nodeconf.NodeConf,
	peerManager peermanager.PeerManager,
	objectGetter syncobjectgetter.SyncObjectGetter,
	storage spacestorage.SpaceStorage) ObjectSync

type RequestFactory

type RequestFactory interface {
	CreateHeadUpdate(t objecttree.ObjectTree, added []*treechangeproto.RawTreeChangeWithId) (msg *treechangeproto.TreeSyncMessage)
	CreateNewTreeRequest() (msg *treechangeproto.TreeSyncMessage)
	CreateFullSyncRequest(t objecttree.ObjectTree, theirHeads, theirSnapshotPath []string) (req *treechangeproto.TreeSyncMessage, err error)
	CreateFullSyncResponse(t objecttree.ObjectTree, theirHeads, theirSnapshotPath []string) (*treechangeproto.TreeSyncMessage, error)
}

func NewRequestFactory

func NewRequestFactory() RequestFactory

type SyncClient

type SyncClient interface {
	RequestFactory
	Broadcast(ctx context.Context, msg *treechangeproto.TreeSyncMessage)
	SendWithReply(ctx context.Context, peerId, objectId string, msg *treechangeproto.TreeSyncMessage, replyId string) (err error)
	SendSync(ctx context.Context, peerId, objectId string, msg *treechangeproto.TreeSyncMessage) (reply *spacesyncproto.ObjectSyncMessage, err error)
	MessagePool() MessagePool
}

func NewSyncClient

func NewSyncClient(
	spaceId string,
	messagePool MessagePool,
	factory RequestFactory) SyncClient

Directories

Path Synopsis
Package mock_objectsync is a generated GoMock package.
Package mock_objectsync is a generated GoMock package.

Jump to

Keyboard shortcuts

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