Move GetMeta storage API to separate interface

This commit is contained in:
Daniel 2021-05-12 15:36:35 +02:00
parent a41ea62d2d
commit 5dc39685da
2 changed files with 26 additions and 8 deletions

View file

@ -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