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 MessageHandler ¶
type MessageHandler func(ctx context.Context, senderId string, message *spacesyncproto.ObjectSyncMessage) (err error)
type MessagePool ¶
type MessagePool interface { LastUsage synchandler.SyncHandler peermanager.PeerManager SendSync(ctx context.Context, peerId string, message *spacesyncproto.ObjectSyncMessage) (reply *spacesyncproto.ObjectSyncMessage, err error) }
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. |
Click to show internal directories.
Click to hide internal directories.