aboutsummaryrefslogtreecommitdiff
path: root/objectdb/objectdb.go
diff options
context:
space:
mode:
Diffstat (limited to 'objectdb/objectdb.go')
-rw-r--r--objectdb/objectdb.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/objectdb/objectdb.go b/objectdb/objectdb.go
index 3e45893a..6e1fbded 100644
--- a/objectdb/objectdb.go
+++ b/objectdb/objectdb.go
@@ -3,6 +3,7 @@ package objectdb
import (
"errors"
+ "io"
"codeberg.org/lindenii/furgit/objectid"
"codeberg.org/lindenii/furgit/objecttype"
@@ -19,6 +20,12 @@ type ObjectDB interface {
ReadBytesFull(id objectid.ObjectID) ([]byte, error)
// ReadBytesContent reads an object's type and content bytes.
ReadBytesContent(id objectid.ObjectID) (objecttype.Type, []byte, error)
+ // ReadReaderFull reads a full serialized object stream as "type size\\x00content".
+ // Caller must close the returned reader.
+ ReadReaderFull(id objectid.ObjectID) (io.ReadCloser, error)
+ // ReadReaderContent reads an object's type and content stream.
+ // Caller must close the returned reader.
+ ReadReaderContent(id objectid.ObjectID) (objecttype.Type, io.ReadCloser, error)
// ReadHeader reads an object's type and declared content length.
ReadHeader(id objectid.ObjectID) (objecttype.Type, int64, error)
// Close releases resources associated with the backend.