From 33a57ddd6fd9fbe4c01afa1fc70051a91b6d81fc Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 30 Mar 2026 18:07:18 +0000 Subject: object/store: Hybrid quarantine interface --- object/store/doc.go | 4 +++- object/store/quarantine_writer.go | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 object/store/quarantine_writer.go (limited to 'object') diff --git a/object/store/doc.go b/object/store/doc.go index cf1ac27d..45acc47c 100644 --- a/object/store/doc.go +++ b/object/store/doc.go @@ -9,7 +9,9 @@ // very different write models: writing one loose object is natural, while // writing one object into a packfile backend is wasteful. Instead, we define // distinct optional capabilities for object-wise writes, pack-wise writes, -// and compose them against quarantined writes. +// and compose them against quarantined writes. Where one logical quarantine +// supports multiple write shapes together, this package also defines a +// coordinated writer quarantine capability. // // Concrete implementations generally inherit the contract documented by the // interfaces they satisfy. Implementation docs focus on additional guarantees diff --git a/object/store/quarantine_writer.go b/object/store/quarantine_writer.go new file mode 100644 index 00000000..f5656a8c --- /dev/null +++ b/object/store/quarantine_writer.go @@ -0,0 +1,21 @@ +package objectstore + +// WriterQuarantine represents one quarantined write that accepts both object- +// wise and pack-wise writes. +type WriterQuarantine interface { + Quarantine + ObjectWriter + PackWriter +} + +// QuarantineOptions controls the options for one coordinated quarantine creation. +type QuarantineOptions struct { + Object ObjectQuarantineOptions + Pack PackQuarantineOptions +} + +// WriterQuarantiner creates coordinated quarantines that support both object- +// wise and pack-wise writes. +type WriterQuarantiner interface { + BeginQuarantine(opts QuarantineOptions) (WriterQuarantine, error) +} -- cgit v1.3.1-10-gc9f91