diff options
| author | 2026-03-30 12:35:47 +0000 | |
|---|---|---|
| committer | 2026-03-30 12:35:47 +0000 | |
| commit | 05a193c9e17e006d2df096ebde7b7d3917f6dfec (patch) | |
| tree | 94724558e762bb41a3679f582ae47d9bce607ea1 /object/store/quarantine.go | |
| parent | object/store: Okay, I intend to have a writing interface. (diff) | |
| signature | No signature | |
object/store: Add quarantine and writer interfaces
Diffstat (limited to 'object/store/quarantine.go')
| -rw-r--r-- | object/store/quarantine.go | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/object/store/quarantine.go b/object/store/quarantine.go new file mode 100644 index 00000000..b827d843 --- /dev/null +++ b/object/store/quarantine.go @@ -0,0 +1,41 @@ +package objectstore + +// Quarantine is one quarantined write. It is intended to be embedded. +type Quarantine interface { + // Reader returns the objects written into this quarantine. + Reader() Reader + + // Promote publishes quarantined writes into their final destination. + Promote() error + + // 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) +} |
