forked from facebookarchive/flashback
-
Notifications
You must be signed in to change notification settings - Fork 0
/
op.go
45 lines (38 loc) · 941 Bytes
/
op.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
package flashback
import (
"time"
)
// OpType is the name of mongo op type
type OpType string
// Document represents the json-like infromation of an op
type Document map[string]interface{}
// Contains a list of mongo op types
const (
Insert OpType = "insert"
Update OpType = "update"
Remove OpType = "remove"
Query OpType = "query"
Command OpType = "command"
Count OpType = "command.count"
FindAndModify OpType = "command.findandmodify"
)
// AllOpTypes specifies all supported op types
var AllOpTypes = []OpType{
Insert,
Update,
Remove,
Query,
Count,
FindAndModify,
}
// Op represents a MongoDB operation that contains enough details to be
// replayed.
type Op struct {
Database string
Collection string
Type OpType
// indicates when this op was performed
Timestamp time.Time
// The details of this op, which may vary from different op types.
Content Document
}