Migation to monorepo
This commit is contained in:
24
chron-core/interfaces.go
Normal file
24
chron-core/interfaces.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package chroncore
|
||||
|
||||
import "context"
|
||||
|
||||
type EntryStore interface {
|
||||
Store(ctx context.Context, entry Entry) error
|
||||
Load(ctx context.Context, id EntryID) (Entry, error)
|
||||
Exists(ctx context.Context, id EntryID) (bool, error)
|
||||
Delete(ctx context.Context, id EntryID) error
|
||||
|
||||
StoreBatch(ctx context.Context, entries []Entry) error
|
||||
LoadBatch(ctx context.Context, ids []EntryID) ([]Entry, error)
|
||||
}
|
||||
|
||||
type ReferenceStore interface {
|
||||
Set(ctx context.Context, name string, entryID EntryID) error
|
||||
Get(ctx context.Context, name string) (EntryID, bool, error)
|
||||
Delete(ctx context.Context, name string) error
|
||||
|
||||
List(ctx context.Context, prefix string) (map[string]EntryID, error)
|
||||
|
||||
SetBatch(ctx context.Context, refs map[string]EntryID) error
|
||||
GetBatch(ctx context.Context, names []string) (map[string]EntryID, error)
|
||||
}
|
||||
Reference in New Issue
Block a user