events: add store implementation (#1957)

This commit is contained in:
ben-toogood
2020-08-20 11:28:04 +01:00
committed by GitHub
parent 8738ed7757
commit 329bc2f265
12 changed files with 213 additions and 53 deletions

View File

@@ -22,7 +22,7 @@ type Stream interface {
// Store of events
type Store interface {
Read(opts ...ReadOption) ([]*Event, error)
Read(topic string, opts ...ReadOption) ([]*Event, error)
Write(event *Event, opts ...WriteOption) error
}
@@ -34,7 +34,7 @@ type Event struct {
Topic string
// Timestamp of the event
Timestamp time.Time
// Metadata contains the encoded event was indexed by
// Metadata contains the values the event was indexed by
Metadata map[string]string
// Payload contains the encoded message
Payload []byte