forked from laizy/web3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
store.go
36 lines (26 loc) · 809 Bytes
/
store.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
28
29
30
31
32
33
34
35
36
package store
import "github.com/laizy/web3"
// Store is a datastore for the tracker
type Store interface {
// Get gets a value
Get(k string) (string, error)
// ListPrefix lists values by prefix
ListPrefix(prefix string) ([]string, error)
// Set sets a value
Set(k, v string) error
// Close closes the store
Close() error
// GetEntry returns a specific entry
GetEntry(hash string) (Entry, error)
}
// Entry is a filter entry in the store
type Entry interface {
// LastIndex returns index of the last stored event
LastIndex() (uint64, error)
// StoreLogs stores the web3 logs of the event
StoreLogs(logs []*web3.Log) error
// RemoveLogs all the logs starting at index 'indx'
RemoveLogs(indx uint64) error
// GetLog returns the log at indx
GetLog(indx uint64, log *web3.Log) error
}