(ctx context.Context, blob blob.Ref, source io.Reader)
| 115 | } |
| 116 | |
| 117 | func (sto *remoteStorage) ReceiveBlob(ctx context.Context, blob blob.Ref, source io.Reader) (outsb blob.SizedRef, outerr error) { |
| 118 | h := &client.UploadHandle{ |
| 119 | BlobRef: blob, |
| 120 | Size: 0, // size isn't known; 0 is fine, but TODO: ask source if it knows its size |
| 121 | Contents: source, |
| 122 | } |
| 123 | pr, err := sto.client.Upload(ctx, h) |
| 124 | if err != nil { |
| 125 | outerr = err |
| 126 | return |
| 127 | } |
| 128 | return pr.SizedBlobRef(), nil |
| 129 | } |
| 130 | |
| 131 | func (sto *remoteStorage) Fetch(ctx context.Context, b blob.Ref) (file io.ReadCloser, size uint32, err error) { |
| 132 | return sto.client.Fetch(ctx, b) |
nothing calls this directly
no test coverage detected