Documentation
¶
Index ¶
Constants ¶
View Source
const ( MethodGetDiff = "GetDiff" MaxGetDiffResponseTime = 15 * time.Second )
Constants related to the GetDiff method.
View Source
const ( MethodGetCheckpoints = "GetCheckpoints" MaxGetCheckpointsResponseTime = 5 * time.Second MaxGetCheckpointsParallelRequests = 5 )
Constants related to the GetCheckpoints method.
View Source
const ( MethodGetCheckpointChunk = "GetCheckpointChunk" MaxGetCheckpointChunkResponseTime = 60 * time.Second )
Constants related to the GetCheckpointChunk method.
View Source
const StorageSyncProtocolID = "storagesync"
StorageSyncProtocolID is a unique protocol identifier for the storage sync protocol.
Variables ¶
View Source
var StorageSyncProtocolVersion = version.Version{Major: 1, Minor: 0, Patch: 0}
StorageSyncProtocolVersion is the supported version of the storage sync protocol.
Functions ¶
Types ¶
type Client ¶
type Client interface {
// GetDiff requests a write log of entries that must be applied to get from the first given root
// to the second one.
GetDiff(ctx context.Context, request *GetDiffRequest) (*GetDiffResponse, rpc.PeerFeedback, error)
// GetCheckpoints returns a list of checkpoint metadata for all known checkpoints.
GetCheckpoints(ctx context.Context, request *GetCheckpointsRequest) (*GetCheckpointsResponse, error)
// GetCheckpointChunk requests a specific checkpoint chunk.
GetCheckpointChunk(ctx context.Context, request *GetCheckpointChunkRequest) (*GetCheckpointChunkResponse, rpc.PeerFeedback, error)
}
Client is a storage sync protocol client.
type GetCheckpointChunkRequest ¶
type GetCheckpointChunkRequest struct {
Version uint16 `json:"version"`
Root storage.Root `json:"root"`
Index uint64 `json:"index"`
Digest hash.Hash `json:"digest"`
}
GetCheckpointChunkRequest is a GetCheckpointChunk request.
type GetCheckpointChunkResponse ¶
type GetCheckpointChunkResponse struct {
Chunk []byte `json:"chunk,omitempty"`
}
GetCheckpointChunkResponse is a respose to a GetCheckpointChunk request.
type GetCheckpointsRequest ¶
type GetCheckpointsRequest struct {
Version uint16 `json:"version"`
}
GetCheckpointsRequest is a GetCheckpoints request.
type GetCheckpointsResponse ¶
type GetCheckpointsResponse struct {
Checkpoints []*checkpoint.Metadata `json:"checkpoints,omitempty"`
}
GetCheckpointsResponse is a response to a GetCheckpoints request.
type GetDiffRequest ¶
type GetDiffRequest struct {
StartRoot storage.Root `json:"start_root"`
EndRoot storage.Root `json:"end_root"`
}
GetDiffRequest is a GetDiff request.
type GetDiffResponse ¶
GetDiffResponse is a response to a GetDiff request.
Click to show internal directories.
Click to hide internal directories.