Read implements backend.Reader
(ctx context.Context, name string, keypath backend.KeyPath, _ *backend.CacheInfo)
| 544 | |
| 545 | // Read implements backend.Reader |
| 546 | func (rw *readerWriter) Read(ctx context.Context, name string, keypath backend.KeyPath, _ *backend.CacheInfo) (io.ReadCloser, int64, error) { |
| 547 | derivedCtx, span := tracer.Start(ctx, "s3.Read") |
| 548 | defer span.End() |
| 549 | |
| 550 | keypath = backend.KeyPathWithPrefix(keypath, rw.cfg.Prefix) |
| 551 | b, err := rw.readAll(derivedCtx, backend.ObjectFileName(keypath, name)) |
| 552 | if err != nil { |
| 553 | return nil, 0, readError(err) |
| 554 | } |
| 555 | |
| 556 | return io.NopCloser(bytes.NewReader(b)), int64(len(b)), err |
| 557 | } |
| 558 | |
| 559 | // ReadRange implements backend.Reader |
| 560 | func (rw *readerWriter) ReadRange(ctx context.Context, name string, keypath backend.KeyPath, offset uint64, buffer []byte, _ *backend.CacheInfo) error { |
nothing calls this directly
no test coverage detected