(ctx context.Context, name string, keypath backend.KeyPath)
| 437 | } |
| 438 | |
| 439 | func (rw *readerWriter) ReadVersioned(ctx context.Context, name string, keypath backend.KeyPath) (io.ReadCloser, backend.Version, error) { |
| 440 | keypath = backend.KeyPathWithPrefix(keypath, rw.cfg.Prefix) |
| 441 | derivedCtx, span := tracer.Start(ctx, "gcs.ReadVersioned", trace.WithAttributes( |
| 442 | attribute.String("object", name), |
| 443 | )) |
| 444 | defer span.End() |
| 445 | |
| 446 | b, attrs, err := rw.readAll(derivedCtx, backend.ObjectFileName(keypath, name)) |
| 447 | if err != nil { |
| 448 | span.SetStatus(codes.Error, "") |
| 449 | return nil, "", readError(err) |
| 450 | } |
| 451 | return io.NopCloser(bytes.NewReader(b)), toVersion(attrs.Generation), nil |
| 452 | } |
| 453 | |
| 454 | func toVersion(generation int64) backend.Version { |
| 455 | return backend.Version(fmt.Sprint(generation)) |
nothing calls this directly
no test coverage detected