26 lines
658 B
Go
26 lines
658 B
Go
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
|
|
}
|