Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultChunkSize = 1000000 DefaultNetworkThreads = 4 DefaultRetryAttempts = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChunkClient ¶
type ChunkClient struct {
// contains filtered or unexported fields
}
ChunkClient is a client for fetching and pushing chunks.
func NewChunkClient ¶
NewChunkClient creates a new chunk client.
func (*ChunkClient) Fetch ¶
func (c *ChunkClient) Fetch(ctx context.Context, hash [contenthash.Size]byte) ([]byte, error)
Fetch retrieves a chunk from the server.
func (*ChunkClient) Push ¶
func (c *ChunkClient) Push(ctx context.Context, hash [contenthash.Size]byte, data []byte) error
Push pushes a chunk to the server.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an object storage client.
func NewClient ¶
func NewClient(grpcObjectClient pb.ObjectClient, chunkClient *ChunkClient) *Client
NewClient creates a new object storage client.
type FetchOpts ¶
type FetchOpts struct {
// NetworkThreads is the number of parallel threads to use for fetching chunks.
NetworkThreads int
// RetryAttempts is the number of times to retry fetching a chunk.
RetryAttempts uint
}
FetchOpts is used to configure the behaviour of fetching an object.
type PushOpts ¶
type PushOpts struct {
// ChunkSize is the nominal size of each chunk.
ChunkSize int64
// NetworkThreads is the number of parallel threads to use for pushing chunks.
NetworkThreads int
// RetryAttempts is the number of times to retry pushing a chunk.
RetryAttempts uint
}
PushOpts is used to configure the behaviour of pushing an object.
Click to show internal directories.
Click to hide internal directories.