Switched to a DAG ledger
This commit is contained in:
@@ -1,18 +1,24 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
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