mirror of
https://github.com/safing/portbase
synced 2025-09-15 09:39:50 +00:00
Improve interfaces and fix more linter errors
This commit is contained in:
parent
5bb73a7b4c
commit
362539692e
11 changed files with 55 additions and 69 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue