-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdata_store.go
More file actions
28 lines (25 loc) · 814 Bytes
/
data_store.go
File metadata and controls
28 lines (25 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package eventmaster
import (
eventmaster "github.com/wish/eventmaster/proto"
)
// DataStore defines the interface needed to be used as a backing store for
// eventmaster.
//
// A few examples include CassandraStore and MockDataStore.
type DataStore interface {
AddEvent(*Event) error
Find(q *eventmaster.Query, topicIDs []string, dcIDs []string, inclData bool) (Events, error)
FindByID(string, bool) (*Event, error)
FindIDs(*eventmaster.TimeQuery, HandleEvent) error
GetTopics() ([]Topic, error)
AddTopic(RawTopic) error
UpdateTopic(RawTopic) error
DeleteTopic(string) error
GetDCs() ([]DC, error)
AddDC(DC) error
UpdateDC(string, string) error
CloseSession()
}
// HandleEvent defines a function for interacting with a stream of events one
// at a time.
type HandleEvent func(eventID string) error