tmpl_helper.go 1.24 KB
Newer Older
1 2
package oncall

John Jarvis's avatar
John Jarvis committed
3
// WeeklyOpsGraph weekly ops grpah
4 5
type WeeklyOpsGraph struct {
	Name string
John Jarvis's avatar
John Jarvis committed
6
	URL  string
7
}
John Jarvis's avatar
John Jarvis committed
8 9 10

// TeamMember info for a team member
type TeamMember struct {
11 12 13 14
	Schedule string
	User     string
}

John Jarvis's avatar
John Jarvis committed
15
// IssueStats for report issues
16
type IssueStats struct {
John Jarvis's avatar
John Jarvis committed
17 18 19 20 21 22
	Count            int
	OnCall           int
	AccessRequest    int
	Critical         int
	Outage           int
	CorrectiveAction int
John Jarvis's avatar
John Jarvis committed
23 24
	Change           int
	Incident         int
25 26
}

John Jarvis's avatar
John Jarvis committed
27
// Issue for oncall labeled issues
28
type Issue struct {
29 30 31 32 33
	Summary        string
	URL            string
	CreatedAt      string
	Assignee       string
	SeverityLabels []string
34 35
}

John Jarvis's avatar
John Jarvis committed
36
// Incident for PD incident
37 38
type Incident struct {
	Summary   string
John Jarvis's avatar
John Jarvis committed
39
	URL       string
40 41
	CreatedAt string
}
John Jarvis's avatar
John Jarvis committed
42 43

//TemplateData for report generation
44
type TemplateData struct {
John Jarvis's avatar
John Jarvis committed
45 46 47
	WeeklyOpsGraphs         []WeeklyOpsGraph
	TeamMembers             []TeamMember
	Incidents               []Incident
48
	OpenOnCallIssues        []Issue
John Jarvis's avatar
John Jarvis committed
49 50
	OpenChangeIssues        []Issue
	OpenIncidentIssues      []Issue
John Jarvis's avatar
John Jarvis committed
51
	CriticalIssues          []Issue
John Jarvis's avatar
John Jarvis committed
52 53
	ChangeIssues            []Issue
	IncidentIssues          []Issue
John Jarvis's avatar
John Jarvis committed
54 55 56 57 58
	OutageIssues            []Issue
	CorrectiveActionIssues  []Issue
	IncidentCount           int
	IssuesOpenAll           IssueStats
	IssuesOpenedDuringShift IssueStats
59
}