diff options
| author | 2026-03-27 09:08:40 +0000 | |
|---|---|---|
| committer | 2026-03-27 09:08:40 +0000 | |
| commit | d7e90798170265b37ea5f980f94ca310cfda3180 (patch) | |
| tree | 89921ca5cb6dd5aaefa3c0ae72352381261cb1e6 /object/storer/chain/bytes.go | |
| parent | CONTRIBUTING: Fix submitting changes deadlines (diff) | |
| signature | No signature | |
object/store: Rename from object/storer
Diffstat (limited to 'object/storer/chain/bytes.go')
| -rw-r--r-- | object/storer/chain/bytes.go | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/object/storer/chain/bytes.go b/object/storer/chain/bytes.go deleted file mode 100644 index d41f3b92..00000000 --- a/object/storer/chain/bytes.go +++ /dev/null @@ -1,46 +0,0 @@ -package chain - -import ( - "errors" - "fmt" - - objectid "codeberg.org/lindenii/furgit/object/id" - objectstorer "codeberg.org/lindenii/furgit/object/storer" - objecttype "codeberg.org/lindenii/furgit/object/type" -) - -// ReadBytesFull reads a full serialized object from the first backend that has it. -func (chain *Chain) ReadBytesFull(id objectid.ObjectID) ([]byte, error) { - for i, backend := range chain.backends { - full, err := backend.ReadBytesFull(id) - if err == nil { - return full, nil - } - - if errors.Is(err, objectstorer.ErrObjectNotFound) { - continue - } - - return nil, fmt.Errorf("objectstorer: backend %d read bytes full: %w", i, err) - } - - return nil, objectstorer.ErrObjectNotFound -} - -// ReadBytesContent reads an object's type and content bytes from the first backend that has it. -func (chain *Chain) ReadBytesContent(id objectid.ObjectID) (objecttype.Type, []byte, error) { - for i, backend := range chain.backends { - ty, content, err := backend.ReadBytesContent(id) - if err == nil { - return ty, content, nil - } - - if errors.Is(err, objectstorer.ErrObjectNotFound) { - continue - } - - return objecttype.TypeInvalid, nil, fmt.Errorf("objectstorer: backend %d read bytes content: %w", i, err) - } - - return objecttype.TypeInvalid, nil, objectstorer.ErrObjectNotFound -} |
