Repository navigation
Expand file tree
/
Copy pathchanges.go
More file actions
89 lines (80 loc) · 1.66 KB
/
Copy pathchanges.go
File metadata and controls
89 lines (80 loc) · 1.66 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
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
package main
import (
"encoding/json"
)
const (
change_endpoint = "/a/changes/%s/detail"
changes_endpoint = "/a/changes/"
)
type ChangeInfo struct {
Branch string
ChangeId string `json:"change_id"`
Created string
CurrentRevision string `json:"current_revision"`
Deletions int
Id string
Insertions int
Kind string
Mergeable bool
Number int `json:"_number"`
Owner struct {
Name string
}
Project string
Reviewed string
Revisions map[string]RevisionInfo
Sortkey string `json:"_sortkey"`
Status string
Subject string
Topic string
Updated string
}
func (changeInfo ChangeInfo) String() string {
ret, _ := json.Marshal(changeInfo)
return string(ret)
}
type FetchInfo struct {
Url string
Ref string
Commands map[string]interface{}
}
func (fetchInfo FetchInfo) String() string {
ret, _ := json.Marshal(fetchInfo)
return string(ret)
}
type RevisionInfo struct {
Draft string
HasDraftComments bool `json:"has_draft_comments"`
Number int `json:"_number"`
Fetch map[string]FetchInfo
}
func (revisionInfo RevisionInfo) String() string {
ret, _ := json.Marshal(revisionInfo)
return string(ret)
}
type ChangeDetail struct {
Kind string
Id string
Project string
Branch string
ChangeId string `json:"change_id"`
Subject string
Status string
Created string
Updated string
Mergeable bool
Insertions int
Deletions int
Sortkey string `json:"_sortkey"`
Number int `json:"_number"`
Owner struct {
Name string
}
Labels struct {
CodeReview struct {
All []struct {
Value int
}
} `json:"Code-Review"`
}
}