syncdeps

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgTypeIncoming = iota
	MsgTypeOutgoing
	MsgTypeIncomingRequest
	MsgTypeOutgoingRequest
	MsgTypeReceivedResponse
	MsgTypeSentResponse
)
View Source
const CName = "common.sync.syncdeps"

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message interface {
	ObjectId() string
	MsgSize() uint64
}

type ObjectSyncHandler

type ObjectSyncHandler interface {
	HandleHeadUpdate(ctx context.Context, statusUpdater syncstatus.StatusUpdater, headUpdate drpc.Message) (Request, error)
	HandleStreamRequest(ctx context.Context, rq Request, updater QueueSizeUpdater, send func(resp proto.Message) error) (Request, error)
	HandleDeprecatedRequest(ctx context.Context, req *spacesyncproto.ObjectSyncMessage) (resp *spacesyncproto.ObjectSyncMessage, err error)
	HandleResponse(ctx context.Context, peerId, objectId string, resp Response) error
	ResponseCollector() ResponseCollector
}

type QueueSizeUpdater

type QueueSizeUpdater interface {
	UpdateQueueSize(size uint64, msgType int, add bool)
}

type Request

type Request interface {
	PeerId() string
	ObjectId() string
	Proto() (proto.Message, error)
	MsgSize() uint64
}

type RequestSender

type RequestSender interface {
	SendRequest(ctx context.Context, rq Request, collector ResponseCollector) error
}

type Response

type Response interface {
	multiqueue.Sizeable
}

type ResponseCollector

type ResponseCollector interface {
	NewResponse() Response
	CollectResponse(ctx context.Context, peerId, objectId string, resp Response) error
}

type SyncHandler

type SyncHandler interface {
	app.Component
	HandleHeadUpdate(ctx context.Context, headUpdate drpc.Message) (Request, error)
	HandleStreamRequest(ctx context.Context, rq Request, updater QueueSizeUpdater, sendResponse func(resp proto.Message) error) (Request, error)
	HandleDeprecatedObjectSync(ctx context.Context, req *spacesyncproto.ObjectSyncMessage) (resp *spacesyncproto.ObjectSyncMessage, err error)
	ApplyRequest(ctx context.Context, rq Request, requestSender RequestSender) error
	SendStreamRequest(ctx context.Context, rq Request, receive func(stream drpc.Stream) error) (err error)
}

Directories

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

Jump to

Keyboard shortcuts

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