-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ccproject.go
53 lines (46 loc) · 1.74 KB
/
ccproject.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
// Package cctray implements the CCTray v1 Specification Standard.
//
// The standard is currently defined at https://cctray.org/v1/
package cctray
import (
"encoding/xml"
"time"
)
// Activity is the type for the Activity response attribute
type Activity string
const (
// ActSleeping indicates activity state is "Sleeping"
ActSleeping Activity = "Sleeping"
// ActBuilding indicates activity state is "Building"
ActBuilding Activity = "Building"
// ActCheckingModifications indicates activity state is "CheckingModifications"
ActCheckingModifications Activity = "CheckingModifications"
)
// Status is the type for the LastBuildStatus response attribute
type Status string
const (
// StatusSuccess indicates last build state was successful
StatusSuccess Status = "Success"
// StatusFailure indicates last build state was an expected failure
StatusFailure Status = "Failure"
// StatusException indicates the last build was an unexpected failure
StatusException Status = "Exception"
// StatusUnknown indicates last build state is not known
StatusUnknown Status = "Unknown"
)
// CCProjects represents the base XML <Projects> node which contains projects
type CCProjects struct {
XMLName xml.Name `xml:"Projects"`
Projects []*CCProject `xml:"Project"`
}
// CCProject represents a <Project> node
type CCProject struct {
XMLName xml.Name `xml:"Project"`
Name string `xml:"name,attr"`
Activity Activity `xml:"activity,attr"`
LastBuildStatus Status `xml:"lastBuildStatus,attr"`
LastBuildLabel string `xml:"lastBuildLabel,attr,omitempty"`
LastBuildTime time.Time `xml:"lastBuildTime,attr"`
NextBuildTime *time.Time `xml:"nextBuildTime,attr,omitempty"`
WebURL string `xml:"webUrl,attr"`
}