-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhooks.go
More file actions
47 lines (41 loc) · 1.23 KB
/
hooks.go
File metadata and controls
47 lines (41 loc) · 1.23 KB
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
package main
// Project is the struct for a repository in VCS
type Project struct {
Id int `json:"id"`
Name string `json:"name"`
FullName string `json:"full_name"`
}
// Branch is the struct for a branch data in VCS
type Branch struct {
Label string `json:"label"`
Ref string `json:"ref"`
Sha string `json:"sha"`
Repo Project `json:"repo"`
}
// PullRequest is the struct for a pull request record in VCS
type PullRequest struct {
Id int `json:"id"`
State string `json:"state"`
Title string `json:"title"`
Body string `json:"body"`
Base Branch `json:"base"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
// BasicHook contains the common parameters for a VCS webhook.
type BasicHook struct {
HookName string `json:"hook_name"`
HookId int `json:"hook_id,omitempty"`
HookUrl string `json:"hook_url,omitempty"`
}
// PullRequestHook is the pull request webhook struct.
type PullRequestHook struct {
BasicHook `json:",inline"`
PullRequest PullRequest `json:"pull_request"`
}
// PushTagHook is the push and tag webhook struct.
type PushTagHook struct {
BasicHook `json:",inline"`
Ref string `json:"ref"`
Project Project `json:"repository"`
}