MCPcopy Index your code
hub / github.com/perkeep/perkeep / ReceiveBlob

Method ReceiveBlob

pkg/server/sync.go:676–684  ·  view source on GitHub ↗
(ctx context.Context, br blob.Ref, r io.Reader)

Source from the content-addressed store, hash-verified

674}
675
676func (sh *SyncHandler) ReceiveBlob(ctx context.Context, br blob.Ref, r io.Reader) (sb blob.SizedRef, err error) {
677 // TODO: use ctx?
678 n, err := io.Copy(io.Discard, r)
679 if err != nil {
680 return
681 }
682 sb = blob.SizedRef{Ref: br, Size: uint32(n)}
683 return sb, sh.enqueue(sb)
684}
685
686// addBlobToCopy adds a blob to copy to memory (not to disk: that's enqueue).
687// It returns true if it was added, or false if it was a duplicate.

Callers

nothing calls this directly

Calls 1

enqueueMethod · 0.95

Tested by

no test coverage detected