ev/pkg/es/driver/driver.go

19 lines
454 B
Go
Raw Normal View History

2022-08-04 14:37:51 -06:00
package driver
import (
"context"
"github.com/sour-is/ev/pkg/es/event"
)
type Driver interface {
Open(string) (EventStore, error)
}
type EventStore interface {
Save(ctx context.Context, agg event.Aggregate) (uint64, error)
Load(ctx context.Context, agg event.Aggregate) error
Read(ctx context.Context, streamID string, pos, count int64) (event.Events, error)
Append(ctx context.Context, streamID string, events event.Events) (uint64, error)
}