-
Notifications
You must be signed in to change notification settings - Fork 174
/
events.go
27 lines (19 loc) · 1.07 KB
/
events.go
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
package storage
import "github.com/onflow/flow-go/model/flow"
// Events represents persistent storage for events.
type Events interface {
// BatchStore will store events for the given block ID in a given batch
BatchStore(blockID flow.Identifier, events []flow.Event, batch BatchStorage) error
// ByBlockID returns the events for the given block ID
ByBlockID(blockID flow.Identifier) ([]flow.Event, error)
// ByBlockIDTransactionID returns the events for the given block ID and transaction ID
ByBlockIDTransactionID(blockID flow.Identifier, transactionID flow.Identifier) ([]flow.Event, error)
// ByBlockIDEventType returns the events for the given block ID and event type
ByBlockIDEventType(blockID flow.Identifier, eventType flow.EventType) ([]flow.Event, error)
}
type ServiceEvents interface {
// BatchStore will store service events for the given block ID in a given batch
BatchStore(blockID flow.Identifier, events []flow.Event, batch BatchStorage) error
// ByBlockID returns the events for the given block ID
ByBlockID(blockID flow.Identifier) ([]flow.Event, error)
}