diff options
| author | 2026-03-06 02:07:35 +0800 | |
|---|---|---|
| committer | 2026-03-06 02:07:35 +0800 | |
| commit | 0d4aadc72ddf286ace361c31840410d86b1eff15 (patch) | |
| tree | db080eeea7102fd79dc0957949a72a31af609dd9 /objectstored/blob.go | |
| parent | repository: Refactor (diff) | |
| signature | No signature | |
objectstored: Split
Diffstat (limited to 'objectstored/blob.go')
| -rw-r--r-- | objectstored/blob.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/objectstored/blob.go b/objectstored/blob.go new file mode 100644 index 00000000..f87af561 --- /dev/null +++ b/objectstored/blob.go @@ -0,0 +1,32 @@ +package objectstored + +import ( + "codeberg.org/lindenii/furgit/object" + "codeberg.org/lindenii/furgit/objectid" +) + +// StoredBlob is a parsed blob paired with its storage ID. +type StoredBlob struct { + id objectid.ObjectID + blob *object.Blob +} + +// NewStoredBlob creates one stored blob wrapper. +func NewStoredBlob(id objectid.ObjectID, blob *object.Blob) *StoredBlob { + return &StoredBlob{id: id, blob: blob} +} + +// ID returns the object ID this blob was loaded from. +func (stored *StoredBlob) ID() objectid.ObjectID { + return stored.id +} + +// Object returns the parsed blob as the generic object interface. +func (stored *StoredBlob) Object() object.Object { + return stored.blob +} + +// Blob returns the parsed blob value. +func (stored *StoredBlob) Blob() *object.Blob { + return stored.blob +} |
