Documentation ¶
Index ¶
- Variables
- func NewRequest(peerId, spaceId, objectId string, heads []string, snapshotPath []string, ...) *objectmessages.Request
- func NewSyncHandler(tree SyncTree, syncClient SyncClient, spaceId string) syncdeps.ObjectSyncHandler
- type BroadcastOptions
- type BuildDeps
- type HeadNotifiable
- type InnerHeadUpdate
- type InnerRequest
- type ListenerSetter
- type RequestFactory
- type Response
- type ResponseProducer
- type ResponsiblePeersGetter
- type SyncClient
- type SyncTree
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnexpectedMessageType = errors.New("unexpected message type") ErrUnexpectedRequestType = errors.New("unexpected request type") ErrUnexpectedResponseType = errors.New("unexpected response type") )
View Source
var ( ErrSyncTreeClosed = errors.New("sync tree is closed") ErrSyncTreeDeleted = errors.New("sync tree is deleted") )
View Source
var (
ErrNoResponsiblePeers = errors.New("no responsible peers")
)
Functions ¶
func NewRequest ¶ added in v0.5.0
func NewRequest(peerId, spaceId, objectId string, heads []string, snapshotPath []string, root *treechangeproto.RawTreeChangeWithId) *objectmessages.Request
func NewSyncHandler ¶ added in v0.5.0
func NewSyncHandler(tree SyncTree, syncClient SyncClient, spaceId string) syncdeps.ObjectSyncHandler
Types ¶
type BroadcastOptions ¶ added in v0.5.0
type BroadcastOptions struct {
EmptyPeers []string
}
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 ValidateObjectTree objecttree.ValidatorFunc }
type HeadNotifiable ¶
type InnerHeadUpdate ¶ added in v0.5.0
type InnerHeadUpdate struct {
// contains filtered or unexported fields
}
func (*InnerHeadUpdate) Heads ¶ added in v0.5.0
func (h *InnerHeadUpdate) Heads() []string
func (*InnerHeadUpdate) Marshall ¶ added in v0.5.0
func (h *InnerHeadUpdate) Marshall(data objectmessages.ObjectMeta) ([]byte, error)
func (*InnerHeadUpdate) MsgSize ¶ added in v0.5.0
func (h *InnerHeadUpdate) MsgSize() (size uint64)
func (*InnerHeadUpdate) Prepare ¶ added in v0.5.0
func (h *InnerHeadUpdate) Prepare() error
type InnerRequest ¶ added in v0.5.0
type InnerRequest struct {
// contains filtered or unexported fields
}
func (*InnerRequest) Marshall ¶ added in v0.5.0
func (r *InnerRequest) Marshall() ([]byte, error)
func (*InnerRequest) MsgSize ¶ added in v0.5.0
func (r *InnerRequest) MsgSize() uint64
type ListenerSetter ¶
type ListenerSetter interface {
SetListener(listener updatelistener.UpdateListener)
}
type RequestFactory ¶ added in v0.2.0
type RequestFactory interface { CreateHeadUpdate(t objecttree.ObjectTree, ignoredPeer string, added []*treechangeproto.RawTreeChangeWithId) (headUpdate *objectmessages.HeadUpdate, err error) CreateNewTreeRequest(peerId, objectId string) *objectmessages.Request CreateFullSyncRequest(peerId string, t objecttree.ObjectTree) *objectmessages.Request CreateResponseProducer(t objecttree.ObjectTree, theirHeads, theirSnapshotPath []string) (ResponseProducer, error) }
func NewRequestFactory ¶ added in v0.2.0
func NewRequestFactory(spaceId string) RequestFactory
type ResponseProducer ¶
type ResponsiblePeersGetter ¶
type SyncClient ¶ added in v0.2.0
type SyncClient interface { RequestFactory Broadcast(ctx context.Context, headUpdate *objectmessages.HeadUpdate) error SendTreeRequest(ctx context.Context, req syncdeps.Request, collector syncdeps.ResponseCollector) (err error) QueueRequest(ctx context.Context, req syncdeps.Request) (err error) }
func NewSyncClient ¶ added in v0.2.0
func NewSyncClient(spaceId string, syncService sync.SyncService) SyncClient
type SyncTree ¶
type SyncTree interface { ListenerSetter SyncWithPeer(ctx context.Context, p peer.Peer) (err error) // contains filtered or unexported methods }
func PutSyncTree ¶
func PutSyncTree(ctx context.Context, payload treestorage.TreeStorageCreatePayload, deps BuildDeps) (t SyncTree, 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.