Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadLargeBlob ¶
func DownloadLargeBlob(ctx context.Context, reg oci.Interface, repo string, dgst oci.Digest) (oci.BlobReader, error)
DownloadLargeBlob downloads a blob using multiple concurrent HTTP range requests to saturate the available bandwidth. It returns a BlobReader whose Read calls yield the bytes in the correct order with full digest verification at EOF.
Internally the function:
- Resolves the blob to obtain its size and digest.
- Issues a small "probe" range request and measures the throughput.
- Derives an optimal chunk size from the observed bandwidth.
- Launches a pipeline of concurrent fetchers that prefetch chunks into an ordered cache so the next chunks are always ready when the caller reads.
func UploadLargeBlob ¶
func UploadLargeBlob(ctx context.Context, reg oci.Interface, repo string, f io.ReadCloser, params *UploadLargeBlobParameters) (oci.Descriptor, error)
UploadLargeBlob uploads a large blob in chunks with retries so that uploads can be resumed in case of network error
Types ¶
type UploadLargeBlobParameters ¶ added in v0.0.13
type UploadLargeBlobParameters struct {
// ChunkSize is the maximum number of bytes to upload at a time.
// If zero or negative, a default of 100 MB is used.
ChunkSize int
// Algorithm is the digest algorithm used to commit the blob.
// If zero, ocidigest.Canonical is used.
Algorithm ocidigest.Algorithm
}
UploadLargeBlobParameters holds optional parameters for UploadLargeBlob.
Click to show internal directories.
Click to hide internal directories.