Make shadow deletes conditional

Also, Move maintenance to separate interface.
This commit is contained in:
Daniel 2020-09-23 17:10:33 +02:00
parent c479430d46
commit 5bb73a7b4c
9 changed files with 83 additions and 45 deletions

View file

@ -18,13 +18,17 @@ type Interface interface {
ReadOnly() bool
Injected() bool
Shutdown() error
}
// Maintenance defines the database storage API for backends that requ
type Maintenance interface {
Maintain(ctx context.Context) error
MaintainThorough(ctx context.Context) error
MaintainRecordStates(ctx context.Context, purgeDeletedBefore time.Time) error
Shutdown() error
}
// Batcher defines the database storage API for backends that support batch operations.
type Batcher interface {
PutMany() (batch chan<- record.Record, errs <-chan error)
PutMany(shadowDelete bool) (batch chan<- record.Record, errs <-chan error)
}