BlobReceiver is the interface for receiving blobs.
| 39 | |
| 40 | // BlobReceiver is the interface for receiving blobs. |
| 41 | type BlobReceiver interface { |
| 42 | // ReceiveBlob accepts a newly uploaded blob and writes it to |
| 43 | // permanent storage. |
| 44 | // |
| 45 | // Implementations of BlobReceiver downstream of the HTTP |
| 46 | // server can trust that the source isn't larger than |
| 47 | // MaxBlobSize and that its digest matches the provided blob |
| 48 | // ref. (If not, the read of the source will fail before EOF) |
| 49 | // |
| 50 | // To ensure those guarantees, callers of ReceiveBlob should |
| 51 | // not call ReceiveBlob directly but instead use either |
| 52 | // blobserver.Receive or blobserver.ReceiveString, which also |
| 53 | // take care of notifying the BlobReceiver's "BlobHub" |
| 54 | // notification bus for observers. |
| 55 | ReceiveBlob(ctx context.Context, br blob.Ref, source io.Reader) (blob.SizedRef, error) |
| 56 | } |
| 57 | |
| 58 | // BlobStatter is the interface for checking the size and existence of blobs. |
| 59 | type BlobStatter interface { |
no outgoing calls
no test coverage detected