aboutsummaryrefslogtreecommitdiff
path: root/object/store/reader.go
diff options
context:
space:
mode:
Diffstat (limited to 'object/store/reader.go')
-rw-r--r--object/store/reader.go19
1 files changed, 14 insertions, 5 deletions
diff --git a/object/store/reader.go b/object/store/reader.go
index e8829b87..bbfe1fe8 100644
--- a/object/store/reader.go
+++ b/object/store/reader.go
@@ -23,12 +23,21 @@ type ObjectReader interface {
// Users should treat this as an invariant;
// implementations should not re-verify it on every read.
//
- // Labels: Life-Parent.
+ // The returned slice may alias storage owned by the backend,
+ // such as a memory-mapped pack or a shared cache buffer.
+ // Callers must not mutate it
+ // and must not retain it past the backend's lifetime.
+ //
+ // Labels: Life-Parent, Mut-No.
ReadBytesFull(id id.ObjectID) ([]byte, error)
// ReadBytesContent reads an object's type and content bytes.
//
- // Labels: Life-Parent.
+ // The returned slice may alias backend-owned storage.
+ // Callers must not mutate it
+ // and must not retain it past the backend's lifetime.
+ //
+ // Labels: Life-Parent, Mut-No.
ReadBytesContent(id id.ObjectID) (typ.Type, []byte, error)
// ReadReaderFull reads a full serialized object stream
@@ -41,17 +50,17 @@ type ObjectReader interface {
// declared content length, and content stream.
//
// Labels: Life-Parent, Close-Caller.
- ReadReaderContent(id id.ObjectID) (typ.Type, uint64, io.ReadCloser, error)
+ ReadReaderContent(id id.ObjectID) (typ.Type, int, io.ReadCloser, error)
// ReadSize reads an object's declared content length.
//
// This returns the same size as the second result of [ObjectReader.ReadHeader];
// for some implementations, this may be cheaper than ReadHeader
// when callers do not need the object type.
- ReadSize(id id.ObjectID) (uint64, error)
+ ReadSize(id id.ObjectID) (int, error)
// ReadHeader reads an object's type and declared content length.
- ReadHeader(id id.ObjectID) (typ.Type, uint64, error)
+ ReadHeader(id id.ObjectID) (typ.Type, int, error)
// Refresh updates any backend-local discovery/cache view of on-disk objects.
//