-
Notifications
You must be signed in to change notification settings - Fork 1
/
gerrit.go
96 lines (88 loc) · 3.6 KB
/
gerrit.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package main
// Structure definitions for gerrit events.
type Approval struct {
Type string `json:"type"`
Description string `json:"description"`
Value string `json:"value"`
OldValue string `json:"oldValue"`
}
type User struct {
Name string `json:"name"`
Email string `json:"email,omitempty"`
Username string `json:"username,omitempty"`
}
type PatchSet struct {
Number int `json:"number"`
Revision string `json:"revision"`
Parents []string `json:"parents"`
Ref string `json:"ref"`
Uploader User `json:"uploader"`
CreatedOn int `json:"createdOn"`
Author User `json:"author"`
Kind string `json:"kind,omitempty"`
SizeInsertions int `json:"sizeInsertions,omitempty"`
SizeDeletions int `json:"sizeDeletions,omitempty"`
}
type Change struct {
Project string `json:"project"`
Branch string `json:"branch"`
ID string `json:"id"`
Number int `json:"number"`
Subject string `json:"subject"`
Owner User `json:"owner"`
Assignee *User `json:"assignee,omitempty"`
URL string `json:"url"`
CommitMessage string `json:"commitMessage"`
CherryPickOfChange int `json:"cherryPickOfChange,omitempty"`
CherryPickOfPatchSet int `json:"cherryPickOfPatchSet,omitempty"`
CreatedOn int `json:"createdOn"`
Status string `json:"status"`
Wip bool `json:"wip,omitempty"`
Topic string `json:"topic,omitempty"`
Private bool `json:"private,omitempty"`
Hashtags []string `json:"hashtags,omitempty"`
}
type ChangeKey struct {
ID string `json:"id"`
}
type RefUpdate struct {
OldRev string `json:"oldRev"`
NewRev string `json:"newRev"`
RefName string `json:"refName"`
Project string `json:"project"`
}
type EventInfo struct {
Abandoner *User `json:"abandoner,omitempty"`
Author *User `json:"author"`
Uploader *User `json:"uploader"`
Reviewer *User `json:"reviewer"`
Adder *User `json:"adder"`
Remover *User `json:"remover"`
Submitter User `json:"submitter,omitempty"`
NewRev string `json:"newRev,omitempty"`
Ref string `json:"ref,omitempty"`
TargetNode string `json:"targetNode,omitempty"`
TargetUri string `json:"targetUri,omitempty"`
Approvals []Approval `json:"approvals,omitempty"`
Comment string `json:"comment,omitempty"`
PatchSet *PatchSet `json:"patchSet"`
Change *Change `json:"change"`
Project string `json:"project"`
RefName string `json:"refName"`
ChangeKey ChangeKey `json:"changeKey"`
RefUpdate *RefUpdate `json:"refUpdate"`
Type string `json:"type"`
Reason string `json:"reason,omitempty"`
EventCreatedOn int `json:"eventCreatedOn"`
Status string `json:"status,omitempty"`
RefStatus string `json:"refStatus,omitempty"`
NodesCount int `json:"nodesCount,omitempty"`
OldTopic string `json:"oldTopic,omitempty"`
Changer *User `json:"changer,omitempty"`
Editor *User `json:"editor,omitempty"`
Restorer *User `json:"restorer,omitempty"`
OldAssignee *User `json:"oldAssignee,omitempty"`
Added []string `json:"added,omitempty"`
Removed []string `json:"removed,omitempty"`
Hashtags []string `json:"hashtags,omitempty"`
}