Documentation
¶
Index ¶
- Variables
- func MarshallTreeMessage(message *treechangeproto.TreeSyncMessage, spaceId, objectId, replyId string) (objMsg *spacesyncproto.ObjectSyncMessage, err error)
- type BuildDeps
- type HeadNotifiable
- type ListenerSetter
- type ReceiveQueue
- type RequestFactory
- type ResponsiblePeersGetter
- type SyncClient
- type SyncTree
- type TreeSyncProtocol
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSyncTreeClosed = errors.New("sync tree is closed") ErrSyncTreeDeleted = errors.New("sync tree is deleted") )
View Source
var ( ErrMessageIsRequest = errors.New("message is request") ErrMessageIsNotRequest = errors.New("message is not request") ErrMoreThanOneRequest = errors.New("more than one request for same peer") )
View Source
var (
ErrNoResponsiblePeers = errors.New("no responsible peers")
)
Functions ¶
func MarshallTreeMessage ¶ added in v0.2.0
func MarshallTreeMessage(message *treechangeproto.TreeSyncMessage, spaceId, objectId, replyId string) (objMsg *spacesyncproto.ObjectSyncMessage, err error)
Types ¶
type BuildDeps ¶
type BuildDeps struct {
SpaceId string
SyncClient SyncClient
Configuration nodeconf.NodeConf
HeadNotifiable HeadNotifiable
Listener updatelistener.UpdateListener
AclList list.AclList
SpaceStorage spacestorage.SpaceStorage
TreeStorage treestorage.TreeStorage
OnClose func(id string)
SyncStatus syncstatus.StatusUpdater
PeerGetter ResponsiblePeersGetter
BuildObjectTree objecttree.BuildObjectTreeFunc
}
type HeadNotifiable ¶
type ListenerSetter ¶
type ListenerSetter interface {
SetListener(listener updatelistener.UpdateListener)
}
type ReceiveQueue ¶
type ReceiveQueue interface {
AddMessage(senderId string, msg *treechangeproto.TreeSyncMessage, replyId string) (queueFull bool)
GetMessage(senderId string) (msg *treechangeproto.TreeSyncMessage, replyId string, err error)
ClearQueue(senderId string)
}
type RequestFactory ¶ added in v0.2.0
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 ¶ added in v0.2.0
func NewRequestFactory() RequestFactory
type ResponsiblePeersGetter ¶
type SyncClient ¶ added in v0.2.0
type SyncClient interface {
RequestFactory
Broadcast(msg *treechangeproto.TreeSyncMessage)
SendUpdate(peerId, objectId string, msg *treechangeproto.TreeSyncMessage) (err error)
QueueRequest(peerId, objectId string, msg *treechangeproto.TreeSyncMessage) (err error)
SendRequest(ctx context.Context, peerId, objectId string, msg *treechangeproto.TreeSyncMessage) (reply *spacesyncproto.ObjectSyncMessage, err error)
}
func NewSyncClient ¶ added in v0.2.0
func NewSyncClient(spaceId string, requestManager requestmanager.RequestManager, peerManager peermanager.PeerManager) SyncClient
type SyncTree ¶
type SyncTree interface {
objecttree.ObjectTree
synchandler.SyncHandler
ListenerSetter
SyncWithPeer(ctx context.Context, peerId string) (err error)
}
func PutSyncTree ¶
func PutSyncTree(ctx context.Context, payload treestorage.TreeStorageCreatePayload, deps BuildDeps) (t SyncTree, err error)
type TreeSyncProtocol ¶ added in v0.2.0
type TreeSyncProtocol interface {
HeadUpdate(ctx context.Context, senderId string, update *treechangeproto.TreeHeadUpdate) (request *treechangeproto.TreeSyncMessage, err error)
FullSyncRequest(ctx context.Context, senderId string, request *treechangeproto.TreeFullSyncRequest) (response *treechangeproto.TreeSyncMessage, err error)
FullSyncResponse(ctx context.Context, senderId string, response *treechangeproto.TreeFullSyncResponse) (err error)
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mock_synctree is a generated GoMock package.
|
Package mock_synctree is a generated GoMock package. |
|
mock_updatelistener
Package mock_updatelistener is a generated GoMock package.
|
Package mock_updatelistener is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.