This repository has been archived by the owner on Nov 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
json.go
81 lines (73 loc) · 2.64 KB
/
json.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
// Copyright 2018 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package main
import (
"time"
)
type issues []issue
func (is issues) Len() int {
return len(is)
}
func (is issues) Less(i, j int) bool {
return is[i].ID < is[j].ID
}
func (is issues) Swap(i, j int) {
is[i], is[j] = is[j], is[i]
}
type issue struct {
Status string `json:"status"`
Priority string `json:"priority"`
Kind string `json:"kind"`
ContentUpdatedOn *time.Time `json:"content_updated_on"`
Voters []interface{} `json:"voters"`
Title string `json:"title"`
Reporter string `json:"reporter"`
Component *string `json:"component"`
Watchers []string `json:"watchers"`
Content string `json:"content"`
Assignee interface{} `json:"assignee"`
CreatedOn time.Time `json:"created_on"`
Version interface{} `json:"version"`
EditedOn *time.Time `json:"edited_on"`
Milestone interface{} `json:"milestone"`
UpdatedOn *time.Time `json:"updated_on"`
ID int `json:"id"`
}
// export represents the contents of a Bitbucket export file.
// It was autogenerated by https://mholt.github.io/json-to-go/ and then tweaked
// a bit, but there are some fields that don't have the correct type because my
// exports didn't use them.
type export struct {
Milestones []interface{} `json:"milestones"`
Attachments []interface{} `json:"attachments"`
Versions []interface{} `json:"versions"`
Comments []struct {
Content *string `json:"content"`
CreatedOn time.Time `json:"created_on"`
User string `json:"user"`
UpdatedOn *time.Time `json:"updated_on"`
Issue int `json:"issue"`
ID int `json:"id"`
} `json:"comments"`
Meta struct {
DefaultMilestone interface{} `json:"default_milestone"`
DefaultAssignee interface{} `json:"default_assignee"`
DefaultKind string `json:"default_kind"`
DefaultComponent interface{} `json:"default_component"`
DefaultVersion interface{} `json:"default_version"`
} `json:"meta"`
Components []struct {
Name string `json:"name"`
} `json:"components"`
Issues issues `json:"issues"`
Logs []struct {
Comment int `json:"comment"`
ChangedTo string `json:"changed_to"`
Field string `json:"field"`
CreatedOn time.Time `json:"created_on"`
User string `json:"user"`
Issue int `json:"issue"`
ChangedFrom string `json:"changed_from"`
} `json:"logs"`
}