diff options
Diffstat (limited to 'object/store/dual/quarantine_begin.go')
| -rw-r--r-- | object/store/dual/quarantine_begin.go | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/object/store/dual/quarantine_begin.go b/object/store/dual/quarantine_begin.go index bca688b7..cd516c3e 100644 --- a/object/store/dual/quarantine_begin.go +++ b/object/store/dual/quarantine_begin.go @@ -2,14 +2,21 @@ package dual import objectstore "codeberg.org/lindenii/furgit/object/store" -// TODO: This doesn't actually make sense. We need a combined quarantine. +// BeginQuarantine creates one coordinated dual quarantine spanning both stores. +// +// Labels: Deps-Borrowed, Life-Parent, Close-No. +func (dual *Dual) BeginQuarantine(opts objectstore.QuarantineOptions) (objectstore.WriterQuarantine, error) { + return dual.beginQuarantine(opts) +} // BeginObjectQuarantine creates one coordinated dual quarantine spanning both // stores and returns it as an object-wise quarantine. // // Labels: Deps-Borrowed, Life-Parent, Close-No. -func (dual *Dual) BeginObjectQuarantine(_ objectstore.ObjectQuarantineOptions) (objectstore.ObjectQuarantine, error) { - quarantine, err := dual.beginQuarantine() +func (dual *Dual) BeginObjectQuarantine(opts objectstore.ObjectQuarantineOptions) (objectstore.ObjectQuarantine, error) { + quarantine, err := dual.beginQuarantine(objectstore.QuarantineOptions{ + Object: opts, + }) if err != nil { return nil, err } @@ -21,8 +28,10 @@ func (dual *Dual) BeginObjectQuarantine(_ objectstore.ObjectQuarantineOptions) ( // stores and returns it as a pack-wise quarantine. // // Labels: Deps-Borrowed, Life-Parent, Close-No. -func (dual *Dual) BeginPackQuarantine(_ objectstore.PackQuarantineOptions) (objectstore.PackQuarantine, error) { - quarantine, err := dual.beginQuarantine() +func (dual *Dual) BeginPackQuarantine(opts objectstore.PackQuarantineOptions) (objectstore.PackQuarantine, error) { + quarantine, err := dual.beginQuarantine(objectstore.QuarantineOptions{ + Pack: opts, + }) if err != nil { return nil, err } @@ -30,13 +39,13 @@ func (dual *Dual) BeginPackQuarantine(_ objectstore.PackQuarantineOptions) (obje return quarantine, nil } -func (dual *Dual) beginQuarantine() (*quarantine, error) { - objectQ, err := dual.object.BeginObjectQuarantine(objectstore.ObjectQuarantineOptions{}) +func (dual *Dual) beginQuarantine(opts objectstore.QuarantineOptions) (*quarantine, error) { + objectQ, err := dual.object.BeginObjectQuarantine(opts.Object) if err != nil { return nil, err } - packQ, err := dual.pack.BeginPackQuarantine(objectstore.PackQuarantineOptions{}) + packQ, err := dual.pack.BeginPackQuarantine(opts.Pack) if err != nil { _ = objectQ.Discard() |
