WIP Scaffholding
This commit is contained in:
25
core/interfaces.go
Normal file
25
core/interfaces.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
)
|
||||
|
||||
type EntryStore interface {
|
||||
Append(ctx context.Context, entry Entry) (EntryID, error)
|
||||
|
||||
Redact(ctx context.Context, entryID EntryID) error
|
||||
|
||||
Get(ctx context.Context, entryID EntryID) (Entry, error)
|
||||
|
||||
ScanForwards(ctx context.Context, entryID EntryID) ([]EntryID, error)
|
||||
ScanBackwards(ctx context.Context, entryID EntryID) ([]EntryID, error)
|
||||
|
||||
Head(ctx context.Context, ledgerID LedgerID) (EntryID, error)
|
||||
IsEmpty(ctx context.Context, ledgerID LedgerID) bool
|
||||
}
|
||||
|
||||
type PayloadStore interface {
|
||||
Put(ctx context.Context, reader io.Reader) (PayloadID, error)
|
||||
Delete(ctx context.Context, payloadID PayloadID) error
|
||||
}
|
||||
Reference in New Issue
Block a user