aboutsummaryrefslogtreecommitdiff
path: root/object
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-30 12:58:26 +0000
committerGravatar Runxi Yu2026-03-30 12:58:26 +0000
commitce22af5eb8c94f2a817fca326efc6bea680e63cc (patch)
treef1a58fa766425dc43290a769c203569ca2f7c4a3 /object
parentobject/store: ObjectWriter should support writers too. (diff)
signatureNo signature
object/store: Reorganize files
Diffstat (limited to 'object')
-rw-r--r--object/store/quarantine.go28
-rw-r--r--object/store/writer_object.go (renamed from object/store/writer.go)17
-rw-r--r--object/store/writer_pack.go26
3 files changed, 37 insertions, 34 deletions
diff --git a/object/store/quarantine.go b/object/store/quarantine.go
index b827d843..1908ab9b 100644
--- a/object/store/quarantine.go
+++ b/object/store/quarantine.go
@@ -11,31 +11,3 @@ type Quarantine interface {
// Discard abandons quarantined writes.
Discard() error
}
-
-// ObjectQuarantine represents one quarantined object-wise write.
-type ObjectQuarantine interface {
- Quarantine
- ObjectWriter
-}
-
-// PackQuarantine represents one quarantined pack-wise write.
-type PackQuarantine interface {
- Quarantine
- PackWriter
-}
-
-// ObjectQuarantineOptions controls the options for one object quarantine creation.
-type ObjectQuarantineOptions struct{}
-
-// PackQuarantineOptions controls the options for one pack quarantine creation.
-type PackQuarantineOptions struct{}
-
-// ObjectQuarantiner creates quarantines for object-wise writes.
-type ObjectQuarantiner interface {
- BeginObjectQuarantine(opts ObjectQuarantineOptions) (ObjectQuarantine, error)
-}
-
-// PackQuarantiner creates quarantines for pack-wise writes.
-type PackQuarantiner interface {
- BeginPackQuarantine(opts PackQuarantineOptions) (PackQuarantine, error)
-}
diff --git a/object/store/writer.go b/object/store/writer_object.go
index 75433ab3..77ffbbcd 100644
--- a/object/store/writer.go
+++ b/object/store/writer_object.go
@@ -22,11 +22,16 @@ type ObjectWriter interface {
WriteBytesFull(raw []byte) (objectid.ObjectID, error)
}
-// PackWriteOptions controls one pack write operation.
-type PackWriteOptions struct{}
+// ObjectQuarantine represents one quarantined object-wise write.
+type ObjectQuarantine interface {
+ Quarantine
+ ObjectWriter
+}
+
+// ObjectQuarantineOptions controls the options for one object quarantine creation.
+type ObjectQuarantineOptions struct{}
-// PackWriter writes Git pack streams.
-type PackWriter interface {
- // WritePack ingests one pack stream.
- WritePack(src io.Reader, opts PackWriteOptions) error
+// ObjectQuarantiner creates quarantines for object-wise writes.
+type ObjectQuarantiner interface {
+ BeginObjectQuarantine(opts ObjectQuarantineOptions) (ObjectQuarantine, error)
}
diff --git a/object/store/writer_pack.go b/object/store/writer_pack.go
new file mode 100644
index 00000000..25c1e8d9
--- /dev/null
+++ b/object/store/writer_pack.go
@@ -0,0 +1,26 @@
+package objectstore
+
+import "io"
+
+// 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
+}
+
+// PackQuarantine represents one quarantined pack-wise write.
+type PackQuarantine interface {
+ Quarantine
+ PackWriter
+}
+
+// PackQuarantineOptions controls the options for one pack quarantine creation.
+type PackQuarantineOptions struct{}
+
+// PackQuarantiner creates quarantines for pack-wise writes.
+type PackQuarantiner interface {
+ BeginPackQuarantine(opts PackQuarantineOptions) (PackQuarantine, error)
+}