mirror of
https://github.com/safing/portbase
synced 2026-04-29 12:20:06 +00:00
Move GetMeta storage API to separate interface
This commit is contained in:
parent
a41ea62d2d
commit
5dc39685da
2 changed files with 26 additions and 8 deletions
|
|
@ -13,7 +13,6 @@ import (
|
|||
type Interface interface {
|
||||
// Primary Interface
|
||||
Get(key string) (record.Record, error)
|
||||
GetMeta(key string) (*record.Meta, error)
|
||||
Put(m record.Record) (record.Record, error)
|
||||
Delete(key string) error
|
||||
Query(q *query.Query, local, internal bool) (*iterator.Iterator, error)
|
||||
|
|
@ -27,6 +26,11 @@ type Interface interface {
|
|||
MaintainRecordStates(ctx context.Context, purgeDeletedBefore time.Time, shadowDelete bool) error
|
||||
}
|
||||
|
||||
// Maintainer defines the database storage API for backends that support optimized fetching of only the metadata.
|
||||
type MetaHandler interface {
|
||||
GetMeta(key string) (*record.Meta, error)
|
||||
}
|
||||
|
||||
// Maintainer defines the database storage API for backends that require regular maintenance.
|
||||
type Maintainer interface {
|
||||
Maintain(ctx context.Context) error
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue