]>
Commit | Line | Data |
---|---|---|
9b12e4fe JC |
1 | package statuscake |
2 | ||
a88e9b9b AG |
3 | import ( |
4 | "strings" | |
5 | ) | |
6 | ||
9b12e4fe JC |
7 | type autheticationErrorResponse struct { |
8 | ErrNo int | |
9 | Error string | |
10 | } | |
11 | ||
12 | type updateResponse struct { | |
13 | Issues interface{} `json:"Issues"` | |
14 | Success bool `json:"Success"` | |
15 | Message string `json:"Message"` | |
16 | InsertID int `json:"InsertID"` | |
17 | } | |
18 | ||
19 | type deleteResponse struct { | |
20 | Success bool `json:"Success"` | |
21 | Error string `json:"Error"` | |
22 | } | |
23 | ||
24 | type detailResponse struct { | |
25 | Method string `json:"Method"` | |
26 | TestID int `json:"TestID"` | |
27 | TestType string `json:"TestType"` | |
28 | Paused bool `json:"Paused"` | |
29 | WebsiteName string `json:"WebsiteName"` | |
30 | URI string `json:"URI"` | |
a88e9b9b | 31 | ContactID string `json:"ContactID"` |
9b12e4fe JC |
32 | Status string `json:"Status"` |
33 | Uptime float64 `json:"Uptime"` | |
a88e9b9b AG |
34 | CustomHeader string `json:"CustomHeader"` |
35 | UserAgent string `json:"UserAgent"` | |
9b12e4fe JC |
36 | CheckRate int `json:"CheckRate"` |
37 | Timeout int `json:"Timeout"` | |
38 | LogoImage string `json:"LogoImage"` | |
39 | Confirmation int `json:"Confirmation,string"` | |
40 | WebsiteHost string `json:"WebsiteHost"` | |
41 | NodeLocations []string `json:"NodeLocations"` | |
42 | FindString string `json:"FindString"` | |
43 | DoNotFind bool `json:"DoNotFind"` | |
44 | LastTested string `json:"LastTested"` | |
45 | NextLocation string `json:"NextLocation"` | |
46 | Port int `json:"Port"` | |
47 | Processing bool `json:"Processing"` | |
48 | ProcessingState string `json:"ProcessingState"` | |
49 | ProcessingOn string `json:"ProcessingOn"` | |
50 | DownTimes int `json:"DownTimes,string"` | |
51 | Sensitive bool `json:"Sensitive"` | |
52 | TriggerRate int `json:"TriggerRate,string"` | |
a88e9b9b AG |
53 | UseJar int `json:"UseJar"` |
54 | PostRaw string `json:"PostRaw"` | |
55 | FinalEndpoint string `json:"FinalEndpoint"` | |
56 | FollowRedirect bool `json:"FollowRedirect"` | |
57 | StatusCodes []string `json:"StatusCodes"` | |
9b12e4fe JC |
58 | } |
59 | ||
60 | func (d *detailResponse) test() *Test { | |
61 | return &Test{ | |
a88e9b9b AG |
62 | TestID: d.TestID, |
63 | TestType: d.TestType, | |
64 | Paused: d.Paused, | |
65 | WebsiteName: d.WebsiteName, | |
66 | WebsiteURL: d.URI, | |
67 | CustomHeader: d.CustomHeader, | |
68 | UserAgent: d.UserAgent, | |
69 | ContactID: d.ContactID, | |
70 | Status: d.Status, | |
71 | Uptime: d.Uptime, | |
72 | CheckRate: d.CheckRate, | |
73 | Timeout: d.Timeout, | |
74 | LogoImage: d.LogoImage, | |
75 | Confirmation: d.Confirmation, | |
76 | WebsiteHost: d.WebsiteHost, | |
77 | NodeLocations: d.NodeLocations, | |
78 | FindString: d.FindString, | |
79 | DoNotFind: d.DoNotFind, | |
80 | Port: d.Port, | |
81 | TriggerRate: d.TriggerRate, | |
82 | UseJar: d.UseJar, | |
83 | PostRaw: d.PostRaw, | |
84 | FinalEndpoint: d.FinalEndpoint, | |
85 | FollowRedirect: d.FollowRedirect, | |
86 | StatusCodes: strings.Join(d.StatusCodes[:], ","), | |
9b12e4fe JC |
87 | } |
88 | } |