(ctx context.Context, br blob.Ref, r io.Reader)
| 674 | } |
| 675 | |
| 676 | func (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. |