-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.go
240 lines (232 loc) · 8.14 KB
/
structs.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
package main
import "time"
type Alert struct {
Action string `json:"action"`
}
// TriggeredAlert represents an event payload for a triggered issue
type TriggeredAlert struct {
Action string `json:"action"`
Installation struct {
UUID string `json:"uuid"`
} `json:"installation"`
Data struct {
Event struct {
EventID string `json:"event_id"`
Project int `json:"project"`
Release interface{} `json:"release"`
Dist interface{} `json:"dist"`
Platform string `json:"platform"`
Message string `json:"message"`
Datetime time.Time `json:"datetime"`
Tags [][]string `json:"tags"`
Metrics struct {
BytesIngestedEvent int `json:"bytes.ingested.event"`
BytesStoredEvent int `json:"bytes.stored.event"`
} `json:"_metrics"`
Ref int `json:"_ref"`
RefVersion int `json:"_ref_version"`
Contexts struct {
Os struct {
Name string `json:"name"`
Version string `json:"version"`
Build string `json:"build"`
KernelVersion string `json:"kernel_version"`
Type string `json:"type"`
} `json:"os"`
Runtime struct {
Name string `json:"name"`
Version string `json:"version"`
Type string `json:"type"`
} `json:"runtime"`
} `json:"contexts"`
Culprit string `json:"culprit"`
Environment string `json:"environment"`
Exception struct {
Values []struct {
Type string `json:"type"`
Value string `json:"value"`
Module string `json:"module"`
Stacktrace struct {
Frames []struct {
Function string `json:"function"`
Filename string `json:"filename"`
AbsPath string `json:"abs_path"`
Lineno int `json:"lineno"`
InApp bool `json:"in_app"`
} `json:"frames"`
} `json:"stacktrace"`
ThreadID int `json:"thread_id"`
} `json:"values"`
} `json:"exception"`
Fingerprint []string `json:"fingerprint"`
GroupingConfig struct {
Enhancements string `json:"enhancements"`
ID string `json:"id"`
} `json:"grouping_config"`
Hashes []string `json:"hashes"`
KeyID string `json:"key_id"`
Level string `json:"level"`
Location string `json:"location"`
Logger string `json:"logger"`
Metadata struct {
DisplayTitleWithTreeLabel bool `json:"display_title_with_tree_label"`
Filename string `json:"filename"`
Function string `json:"function"`
Type string `json:"type"`
Value string `json:"value"`
} `json:"metadata"`
Modules struct {
ZxcvbnRuby string `json:"zxcvbn-ruby"`
} `json:"modules"`
NodestoreInsert float64 `json:"nodestore_insert"`
Received float64 `json:"received"`
Sdk struct {
Name string `json:"name"`
Version string `json:"version"`
} `json:"sdk"`
Threads struct {
Values []struct {
ID int `json:"id"`
Crashed bool `json:"crashed"`
Current bool `json:"current"`
} `json:"values"`
} `json:"threads"`
Timestamp float64 `json:"timestamp"`
Title string `json:"title"`
Type string `json:"type"`
Version string `json:"version"`
URL string `json:"url"`
WebURL string `json:"web_url"`
IssueURL string `json:"issue_url"`
IssueID string `json:"issue_id"`
} `json:"event"`
TriggeredRule string `json:"triggered_rule"`
} `json:"data"`
Actor struct {
Type string `json:"type"`
ID string `json:"id"`
Name string `json:"name"`
} `json:"actor"`
}
// CreatedAlert represents an event payload for a new issue creation event
type CreatedAlert struct {
Action string `json:"action"`
Installation struct {
UUID string `json:"uuid"`
} `json:"installation"`
Data struct {
Issue struct {
ID string `json:"id"`
ShareID interface{} `json:"shareId"`
ShortID string `json:"shortId"`
Title string `json:"title"`
Culprit string `json:"culprit"`
Permalink interface{} `json:"permalink"`
Logger interface{} `json:"logger"`
Level string `json:"level"`
Status string `json:"status"`
StatusDetails struct {
} `json:"statusDetails"`
IsPublic bool `json:"isPublic"`
Platform string `json:"platform"`
Project struct {
ID string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Platform string `json:"platform"`
} `json:"project"`
Type string `json:"type"`
Metadata struct {
Value string `json:"value"`
Type string `json:"type"`
Filename string `json:"filename"`
Function string `json:"function"`
DisplayTitleWithTreeLabel bool `json:"display_title_with_tree_label"`
} `json:"metadata"`
NumComments int `json:"numComments"`
AssignedTo interface{} `json:"assignedTo"`
IsBookmarked bool `json:"isBookmarked"`
IsSubscribed bool `json:"isSubscribed"`
SubscriptionDetails interface{} `json:"subscriptionDetails"`
HasSeen bool `json:"hasSeen"`
Annotations []interface{} `json:"annotations"`
IsUnhandled bool `json:"isUnhandled"`
Count string `json:"count"`
UserCount int `json:"userCount"`
FirstSeen time.Time `json:"firstSeen"`
LastSeen time.Time `json:"lastSeen"`
} `json:"issue"`
} `json:"data"`
}
type ResolvedAlert struct {
Action string `json:"action"`
Installation struct {
UUID string `json:"uuid"`
} `json:"installation"`
Data struct {
ResolutionType string `json:"resolution_type"`
Issue struct {
ID string `json:"id"`
ShareID interface{} `json:"shareId"`
ShortID string `json:"shortId"`
Title string `json:"title"`
Culprit string `json:"culprit"`
Permalink interface{} `json:"permalink"`
Logger interface{} `json:"logger"`
Level string `json:"level"`
Status string `json:"status"`
StatusDetails struct {
} `json:"statusDetails"`
IsPublic bool `json:"isPublic"`
Platform string `json:"platform"`
Project struct {
ID string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Platform string `json:"platform"`
} `json:"project"`
Type string `json:"type"`
Metadata struct {
Value string `json:"value"`
Type string `json:"type"`
Filename string `json:"filename"`
Function string `json:"function"`
DisplayTitleWithTreeLabel bool `json:"display_title_with_tree_label"`
} `json:"metadata"`
NumComments int `json:"numComments"`
AssignedTo interface{} `json:"assignedTo"`
IsBookmarked bool `json:"isBookmarked"`
IsSubscribed bool `json:"isSubscribed"`
SubscriptionDetails interface{} `json:"subscriptionDetails"`
HasSeen bool `json:"hasSeen"`
Annotations []interface{} `json:"annotations"`
IsUnhandled bool `json:"isUnhandled"`
Count string `json:"count"`
UserCount int `json:"userCount"`
FirstSeen time.Time `json:"firstSeen"`
LastSeen time.Time `json:"lastSeen"`
} `json:"issue"`
} `json:"data"`
Actor struct {
Type string `json:"type"`
ID int `json:"id"`
Name string `json:"name"`
} `json:"actor"`
}
type WebhookPayload struct {
Channel string `json:"channel"`
Attachments []Attachment `json:"attachments"`
}
type Attachment struct {
Title string `json:"title"`
TitleLink string `json:"title_link"`
Color string `json:"color"`
AuthorName string `json:"author_name"`
AuthorIcon string `json:"author_icon"`
Fields []Field `json:"fields"`
}
type Field struct {
Short bool `json:"short"`
Title string `json:"title"`
Value string `json:"value"`
}