MCPcopy
hub / github.com/perkeep/perkeep / Receive

Function Receive

pkg/blobserver/receive.go:43–45  ·  view source on GitHub ↗

Receive wraps calling a BlobReceiver's ReceiveBlob method, additionally providing verification of the src digest, and also notifying the blob hub on success. The error will be ErrCorruptBlob if the blobref didn't match.

(ctx context.Context, dst BlobReceiver, br blob.Ref, src io.Reader)

Source from the content-addressed store, hash-verified

41// notifying the blob hub on success.
42// The error will be ErrCorruptBlob if the blobref didn't match.
43func Receive(ctx context.Context, dst BlobReceiver, br blob.Ref, src io.Reader) (blob.SizedRef, error) {
44 return receive(ctx, dst, br, src, true)
45}
46
47func ReceiveNoHash(ctx context.Context, dst BlobReceiver, br blob.Ref, src io.Reader) (blob.SizedRef, error) {
48 return receive(ctx, dst, br, src, false)

Callers 15

UploadMethod · 0.92
ReceiveBlobMethod · 0.92
faultInMethod · 0.92
TestReceiveFunction · 0.92
TestReceiveCorruptFunction · 0.92
uploadTestBlobsFunction · 0.92
TestDoubleReceiveFunction · 0.92
TestCloseFunction · 0.92
mustReceiveFunction · 0.92
mustReceiveFunction · 0.92
ReceiveBlobMethod · 0.92

Calls 1

receiveFunction · 0.85

Tested by 10

TestReceiveFunction · 0.74
TestReceiveCorruptFunction · 0.74
uploadTestBlobsFunction · 0.74
TestDoubleReceiveFunction · 0.74
TestCloseFunction · 0.74
mustReceiveFunction · 0.74
mustReceiveFunction · 0.74
populateFunction · 0.74
putRawMethod · 0.74