aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor
diff options
context:
space:
mode:
Diffstat (limited to 'vendor')
-rw-r--r--vendor/github.com/DreamItGetIT/statuscake/responses.go54
-rw-r--r--vendor/github.com/DreamItGetIT/statuscake/tests.go31
-rw-r--r--vendor/vendor.json6
3 files changed, 70 insertions, 21 deletions
diff --git a/vendor/github.com/DreamItGetIT/statuscake/responses.go b/vendor/github.com/DreamItGetIT/statuscake/responses.go
index b9216b7..3cbf36d 100644
--- a/vendor/github.com/DreamItGetIT/statuscake/responses.go
+++ b/vendor/github.com/DreamItGetIT/statuscake/responses.go
@@ -1,5 +1,9 @@
1package statuscake 1package statuscake
2 2
3import (
4 "strings"
5)
6
3type autheticationErrorResponse struct { 7type autheticationErrorResponse struct {
4 ErrNo int 8 ErrNo int
5 Error string 9 Error string
@@ -27,6 +31,8 @@ type detailResponse struct {
27 ContactID int `json:"ContactID"` 31 ContactID int `json:"ContactID"`
28 Status string `json:"Status"` 32 Status string `json:"Status"`
29 Uptime float64 `json:"Uptime"` 33 Uptime float64 `json:"Uptime"`
34 CustomHeader string `json:"CustomHeader"`
35 UserAgent string `json:"UserAgent"`
30 CheckRate int `json:"CheckRate"` 36 CheckRate int `json:"CheckRate"`
31 Timeout int `json:"Timeout"` 37 Timeout int `json:"Timeout"`
32 LogoImage string `json:"LogoImage"` 38 LogoImage string `json:"LogoImage"`
@@ -44,27 +50,39 @@ type detailResponse struct {
44 DownTimes int `json:"DownTimes,string"` 50 DownTimes int `json:"DownTimes,string"`
45 Sensitive bool `json:"Sensitive"` 51 Sensitive bool `json:"Sensitive"`
46 TriggerRate int `json:"TriggerRate,string"` 52 TriggerRate int `json:"TriggerRate,string"`
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"`
47} 58}
48 59
49func (d *detailResponse) test() *Test { 60func (d *detailResponse) test() *Test {
50 return &Test{ 61 return &Test{
51 TestID: d.TestID, 62 TestID: d.TestID,
52 TestType: d.TestType, 63 TestType: d.TestType,
53 Paused: d.Paused, 64 Paused: d.Paused,
54 WebsiteName: d.WebsiteName, 65 WebsiteName: d.WebsiteName,
55 WebsiteURL: d.URI, 66 WebsiteURL: d.URI,
56 ContactID: d.ContactID, 67 CustomHeader: d.CustomHeader,
57 Status: d.Status, 68 UserAgent: d.UserAgent,
58 Uptime: d.Uptime, 69 ContactID: d.ContactID,
59 CheckRate: d.CheckRate, 70 Status: d.Status,
60 Timeout: d.Timeout, 71 Uptime: d.Uptime,
61 LogoImage: d.LogoImage, 72 CheckRate: d.CheckRate,
62 Confirmation: d.Confirmation, 73 Timeout: d.Timeout,
63 WebsiteHost: d.WebsiteHost, 74 LogoImage: d.LogoImage,
64 NodeLocations: d.NodeLocations, 75 Confirmation: d.Confirmation,
65 FindString: d.FindString, 76 WebsiteHost: d.WebsiteHost,
66 DoNotFind: d.DoNotFind, 77 NodeLocations: d.NodeLocations,
67 Port: d.Port, 78 FindString: d.FindString,
68 TriggerRate: d.TriggerRate, 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[:], ","),
69 } 87 }
70} 88}
diff --git a/vendor/github.com/DreamItGetIT/statuscake/tests.go b/vendor/github.com/DreamItGetIT/statuscake/tests.go
index 4053e53..a41b0bd 100644
--- a/vendor/github.com/DreamItGetIT/statuscake/tests.go
+++ b/vendor/github.com/DreamItGetIT/statuscake/tests.go
@@ -21,6 +21,12 @@ type Test struct {
21 // Website name. Tags are stripped out 21 // Website name. Tags are stripped out
22 WebsiteName string `json:"WebsiteName" querystring:"WebsiteName"` 22 WebsiteName string `json:"WebsiteName" querystring:"WebsiteName"`
23 23
24 // CustomHeader. A special header that will be sent along with the HTTP tests.
25 CustomHeader string `json:"CustomHeader" querystring:"CustomHeader"`
26
27 // Use to populate the test with a custom user agent
28 UserAgent string `json:"UserAgent" queryString:"UserAgent"`
29
24 // Test location, either an IP (for TCP and Ping) or a fully qualified URL for other TestTypes 30 // Test location, either an IP (for TCP and Ping) or a fully qualified URL for other TestTypes
25 WebsiteURL string `json:"WebsiteURL" querystring:"WebsiteURL"` 31 WebsiteURL string `json:"WebsiteURL" querystring:"WebsiteURL"`
26 32
@@ -91,6 +97,18 @@ type Test struct {
91 97
92 // Comma Seperated List of StatusCodes to Trigger Error on (on Update will replace, so send full list each time) 98 // Comma Seperated List of StatusCodes to Trigger Error on (on Update will replace, so send full list each time)
93 StatusCodes string `json:"StatusCodes" querystring:"StatusCodes"` 99 StatusCodes string `json:"StatusCodes" querystring:"StatusCodes"`
100
101 // Set to 1 to enable the Cookie Jar. Required for some redirects.
102 UseJar int `json:"UseJar" querystring:"UseJar"`
103
104 // Raw POST data seperated by an ampersand
105 PostRaw string `json:"PostRaw" querystring:"PostRaw"`
106
107 // Use to specify the expected Final URL in the testing process
108 FinalEndpoint string `json:"FinalEndpoint" querystring:"FinalEndpoint"`
109
110 // Use to specify whether redirects should be followed
111 FollowRedirect bool `json:"FollowRedirect" querystring:"FollowRedirect"`
94} 112}
95 113
96// Validate checks if the Test is valid. If it's invalid, it returns a ValidationError with all invalid fields. It returns nil otherwise. 114// Validate checks if the Test is valid. If it's invalid, it returns a ValidationError with all invalid fields. It returns nil otherwise.
@@ -137,6 +155,19 @@ func (t *Test) Validate() error {
137 e["TriggerRate"] = "must be between 0 and 59" 155 e["TriggerRate"] = "must be between 0 and 59"
138 } 156 }
139 157
158 if t.PostRaw != "" && t.TestType != "HTTP" {
159 e["PostRaw"] = "must be HTTP to submit a POST request"
160 }
161
162 if t.FinalEndpoint != "" && t.TestType != "HTTP" {
163 e["FinalEndpoint"] = "must be a Valid URL"
164 }
165
166 var jsonVerifiable map[string]interface{}
167 if json.Unmarshal([]byte(t.CustomHeader), &jsonVerifiable) != nil {
168 e["CustomHeader"] = "must be provided as json string"
169 }
170
140 if len(e) > 0 { 171 if len(e) > 0 {
141 return e 172 return e
142 } 173 }
diff --git a/vendor/vendor.json b/vendor/vendor.json
index 8b44fbd..61dd8f3 100644
--- a/vendor/vendor.json
+++ b/vendor/vendor.json
@@ -3,10 +3,10 @@
3 "ignore": "appengine test github.com/hashicorp/nomad/ github.com/hashicorp/terraform/backend", 3 "ignore": "appengine test github.com/hashicorp/nomad/ github.com/hashicorp/terraform/backend",
4 "package": [ 4 "package": [
5 { 5 {
6 "checksumSHA1": "MV5JueYPwNkLZ+KNqmDcNDhsKi4=", 6 "checksumSHA1": "6Fo7YzTT+MDviHOsqg6dNw8WrV4=",
7 "path": "github.com/DreamItGetIT/statuscake", 7 "path": "github.com/DreamItGetIT/statuscake",
8 "revision": "acc13ec021cd1e8a6ebb1d9035f513217f5c4562", 8 "revision": "f69198f958d7326f3c110dd9be1c21abbd8a87a7",
9 "revisionTime": "2017-04-10T11:34:45Z" 9 "revisionTime": "2018-01-30T22:14:43Z"
10 }, 10 },
11 { 11 {
12 "checksumSHA1": "FIL83loX9V9APvGQIjJpbxq53F0=", 12 "checksumSHA1": "FIL83loX9V9APvGQIjJpbxq53F0=",