forked from ravendb/ravendb-go-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathi_command_data.go
43 lines (36 loc) · 849 Bytes
/
i_command_data.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
package ravendb
// ICommandData represents command data
type ICommandData interface {
getId() string
getName() string
getChangeVector() *string
getType() CommandType
serialize(conventions *DocumentConventions) (interface{}, error)
}
// CommandData describes common data for commands
type CommandData struct {
ID string
Name string
ChangeVector *string
Type CommandType
}
func (d *CommandData) getId() string {
return d.ID
}
func (d *CommandData) getName() string {
return d.Name
}
func (d *CommandData) getType() string {
return d.Type
}
func (d *CommandData) getChangeVector() *string {
return d.ChangeVector
}
func (d *CommandData) baseJSON() map[string]interface{} {
res := map[string]interface{}{
"Id": d.ID,
"Type": d.Type,
"ChangeVector": d.ChangeVector,
}
return res
}