forked from dfuse-io/eosws-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtables.go
50 lines (39 loc) · 969 Bytes
/
tables.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package eosws
import (
"encoding/json"
v1 "github.com/dfuse-io/eosws-go/mdl/v1"
)
func init() {
RegisterOutgoingMessage("get_table_rows", GetTableRows{})
RegisterIncomingMessage("table_delta", TableDelta{})
RegisterIncomingMessage("table_snapshot", TableSnapshot{})
}
type GetTableRows struct {
CommonOut
Data struct {
JSON bool `json:"json,omitempty"`
Verbose bool `json:"verbose,omitempty"`
Code string `json:"code"`
Scope string `json:"scope"`
Table string `json:"table"`
} `json:"data"`
}
type TableDelta struct {
CommonIn
Data struct {
BlockNum uint32 `json:"block_num"`
DBOp *v1.DBOp `json:"dbop"`
Step string `json:"step"`
} `json:"data"`
}
type TableSnapshot struct {
CommonIn
Data struct {
BlockNum uint32 `json:"block_num"`
Rows []json.RawMessage `json:"rows"`
} `json:"data"`
}
type TableSnapshotRow struct {
Key string `json:"key"`
Data json.RawMessage `json:"data"`
}