Improve interfaces and fix more linter errors

This commit is contained in:
Daniel 2020-09-24 09:50:38 +02:00
parent 5bb73a7b4c
commit 362539692e
11 changed files with 55 additions and 69 deletions

View file

@ -11,21 +11,25 @@ import (
// Interface defines the database storage API.
type Interface interface {
// Primary Interface
Get(key string) (record.Record, error)
Put(m record.Record) (record.Record, error)
Delete(key string) error
Query(q *query.Query, local, internal bool) (*iterator.Iterator, error)
// Information and Control
ReadOnly() bool
Injected() bool
Shutdown() error
// Mandatory Record Maintenance
MaintainRecordStates(ctx context.Context, purgeDeletedBefore time.Time) error
}
// Maintenance defines the database storage API for backends that requ
type Maintenance interface {
// Maintainer defines the database storage API for backends that require regular maintenance.
type Maintainer interface {
Maintain(ctx context.Context) error
MaintainThorough(ctx context.Context) error
MaintainRecordStates(ctx context.Context, purgeDeletedBefore time.Time) error
}
// Batcher defines the database storage API for backends that support batch operations.