aboutsummaryrefslogtreecommitdiff
path: root/object/store/writer.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-30 12:35:47 +0000
committerGravatar Runxi Yu2026-03-30 12:35:47 +0000
commit05a193c9e17e006d2df096ebde7b7d3917f6dfec (patch)
tree94724558e762bb41a3679f582ae47d9bce607ea1 /object/store/writer.go
parentobject/store: Okay, I intend to have a writing interface. (diff)
signatureNo signature
object/store: Add quarantine and writer interfaces
Diffstat (limited to 'object/store/writer.go')
-rw-r--r--object/store/writer.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/object/store/writer.go b/object/store/writer.go
new file mode 100644
index 00000000..e65134ba
--- /dev/null
+++ b/object/store/writer.go
@@ -0,0 +1,26 @@
+package objectstore
+
+import (
+ "io"
+
+ objectid "codeberg.org/lindenii/furgit/object/id"
+ objecttype "codeberg.org/lindenii/furgit/object/type"
+)
+
+// ObjectWriter writes individual Git objects.
+type ObjectWriter interface {
+ // WriteContent writes one typed object content stream.
+ WriteContent(ty objecttype.Type, size int64, src io.Reader) (objectid.ObjectID, error)
+
+ // WriteFull writes one full serialized object stream as "type size\0content".
+ WriteFull(src io.Reader) (objectid.ObjectID, error)
+}
+
+// PackWriteOptions controls one pack write operation.
+type PackWriteOptions struct{}
+
+// PackWriter writes Git pack streams.
+type PackWriter interface {
+ // WritePack ingests one pack stream.
+ WritePack(src io.Reader, opts PackWriteOptions) error
+}