diff options
| author | 2026-02-21 01:47:11 +0800 | |
|---|---|---|
| committer | 2026-02-21 01:47:11 +0800 | |
| commit | e936d246576e8bf714dbf8666e9349a5f22be87e (patch) | |
| tree | 2e97a53b076627958f2babbb0bdd732dafcaa381 /objectdb/objectdb.go | |
| parent | objectdb/chain: Chain belongs separately from objectdb (diff) | |
| signature | No signature | |
objectstore: Rename from objectdb
Diffstat (limited to 'objectdb/objectdb.go')
| -rw-r--r-- | objectdb/objectdb.go | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/objectdb/objectdb.go b/objectdb/objectdb.go deleted file mode 100644 index 6e1fbded..00000000 --- a/objectdb/objectdb.go +++ /dev/null @@ -1,33 +0,0 @@ -// Package objectdb provides storage interfaces for Git objects. -package objectdb - -import ( - "errors" - "io" - - "codeberg.org/lindenii/furgit/objectid" - "codeberg.org/lindenii/furgit/objecttype" -) - -// ErrObjectNotFound indicates that an object does not exist in a backend. -// TODO: This might need to be an interface or otherwise be able to encapsulate multiple concrete backends' -var ErrObjectNotFound = errors.New("objectdb: object not found") - -// ObjectDB reads Git objects by object ID. -type ObjectDB interface { - // ReadBytesFull reads a full serialized object as "type size\\x00content". - // If hashed with the same algorithm it MUST match the object ID. - 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. - Close() error -} |
