module github.com/terraform-providers/terraform-provider-statuscake
require (
- github.com/DreamItGetIT/statuscake v0.0.0-20180728152938-85edefcbdaa3
+ github.com/DreamItGetIT/statuscake v0.0.0-20190218105717-471b24d8edfb
github.com/hashicorp/terraform v0.12.0
)
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022 h1:y8Gs8CzNfDF5AZvjr+5UyGQvQEBL7pwo+v+wX6q9JI8=
github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4=
-github.com/DreamItGetIT/statuscake v0.0.0-20180728152938-85edefcbdaa3 h1:BmnYSwnNifByVfy5Yp3AxiEWAS4EkzK0Cu6/Rh/7mu4=
-github.com/DreamItGetIT/statuscake v0.0.0-20180728152938-85edefcbdaa3/go.mod h1:OclNh7ZacJo61GDJablmsOZ7l8/AVtzGqP8G7baOdAs=
+github.com/DreamItGetIT/statuscake v0.0.0-20190218105717-471b24d8edfb h1:vJ3lnCyZNmSV/OKyw4d7GuZHFrUaa3FY6/NqtvRE0lw=
+github.com/DreamItGetIT/statuscake v0.0.0-20190218105717-471b24d8edfb/go.mod h1:OclNh7ZacJo61GDJablmsOZ7l8/AVtzGqP8G7baOdAs=
github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292 h1:tuQ7w+my8a8mkwN7x2TSd7OzTjkZ7rAeSyH4xncuAMI=
github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no=
github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw=
--- /dev/null
+language: go
+go:
+ - "1.x"
+
+env:
+ - DEP_VERSION="0.5.0"
+
+before_install:
+ # Install dep
+ - curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
+ - chmod +x $GOPATH/bin/dep
+
+ # Install golint
+ - go get golang.org/x/lint/golint
--- /dev/null
+# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
+
+
+[[projects]]
+ branch = "master"
+ digest = "1:27dce89d419e7be582ae735623fb0b538012e62b08a87c0308c3b360de2a74b0"
+ name = "github.com/DreamItGetIT/statuscake"
+ packages = ["."]
+ pruneopts = "UT"
+ revision = "49ae6aae1769b896774d7e860e620f1bd8221355"
+
+[[projects]]
+ digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec"
+ name = "github.com/davecgh/go-spew"
+ packages = ["spew"]
+ pruneopts = "UT"
+ revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73"
+ version = "v1.1.1"
+
+[[projects]]
+ digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe"
+ name = "github.com/pmezard/go-difflib"
+ packages = ["difflib"]
+ pruneopts = "UT"
+ revision = "792786c7400a136282c1664665ae0a8db921c6c2"
+ version = "v1.0.0"
+
+[[projects]]
+ digest = "1:c40d65817cdd41fac9aa7af8bed56927bb2d6d47e4fea566a74880f5c2b1c41e"
+ name = "github.com/stretchr/testify"
+ packages = [
+ "assert",
+ "require",
+ ]
+ pruneopts = "UT"
+ revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686"
+ version = "v1.2.2"
+
+[solve-meta]
+ analyzer-name = "dep"
+ analyzer-version = 1
+ input-imports = [
+ "github.com/DreamItGetIT/statuscake",
+ "github.com/stretchr/testify/assert",
+ "github.com/stretchr/testify/require",
+ ]
+ solver-name = "gps-cdcl"
+ solver-version = 1
--- /dev/null
+# Gopkg.toml example
+#
+# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
+# for detailed Gopkg.toml documentation.
+#
+# required = ["github.com/user/thing/cmd/thing"]
+# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
+#
+# [[constraint]]
+# name = "github.com/user/project"
+# version = "1.0.0"
+#
+# [[constraint]]
+# name = "github.com/user/project2"
+# branch = "dev"
+# source = "github.com/myfork/project2"
+#
+# [[override]]
+# name = "github.com/x/y"
+# version = "2.4.0"
+#
+# [prune]
+# non-go = false
+# go-tests = true
+# unused-packages = true
+
+
+[[constraint]]
+ branch = "master"
+ name = "github.com/DreamItGetIT/statuscake"
+
+[[constraint]]
+ name = "github.com/stretchr/testify"
+ version = "1.2.2"
+
+[prune]
+ go-tests = true
+ unused-packages = true
# statuscake
+[![Build Status](https://travis-ci.org/DreamItGetIT/statuscake.svg?branch=master)](https://travis-ci.org/DreamItGetIT/statuscake)
+
`statuscake` is a Go pkg that implements a client for the [statuscake]("https://statuscake.com") API.
More documentation and examples at [http://godoc.org/github.com/DreamItGetIT/statuscake](http://godoc.org/github.com/DreamItGetIT/statuscake).
// log.Fatal(err)
// }
//
+// v := url.Values{}
+// v.Set("tags", "test1,test2")
+// testsWithFilter, err := c.Tests().AllWithFilter(v)
+// if err != nil {
+// log.Fatal(err)
+// }
+//
// // delete a `Test`
// err = c.Tests().Delete(TestID)
//
// log.Fatal(err)
// }
//
-// t2 := c.Tests().Update(t)
+// t2, err := c.Tests().Update(t)
+// if err != nil {
+// log.Fatal(err)
+// }
// fmt.Printf("New Test created with id: %d\n", t2.TestID)
//
// // get Tests details
-.PHONY: default lint test
+.PHONY: default deps lint test
-default: lint test
+default: deps lint test
lint:
@golint ./...
test:
go test ${GOTEST_ARGS} ./...
+deps:
+ dep ensure
\ No newline at end of file
UseJar int `json:"UseJar"`
PostRaw string `json:"PostRaw"`
FinalEndpoint string `json:"FinalEndpoint"`
+ EnableSSLWarning bool `json:"EnableSSLWarning"`
FollowRedirect bool `json:"FollowRedirect"`
StatusCodes []string `json:"StatusCodes"`
}
UseJar: d.UseJar,
PostRaw: d.PostRaw,
FinalEndpoint: d.FinalEndpoint,
+ EnableSSLAlert: d.EnableSSLWarning,
FollowRedirect: d.FollowRedirect,
StatusCodes: strings.Join(d.StatusCodes[:], ","),
}
// Current status at last test
Status string `json:"Status"`
- // 7 Day Uptime
+ // 1 Day Uptime
Uptime float64 `json:"Uptime"`
// Any test locations seperated by a comma (using the Node Location IDs)
Branding int `json:"Branding" querystring:"Branding"`
// Used internally by the statuscake API
- WebsiteHost string `json:"WebsiteHost"`
+ WebsiteHost string `json:"WebsiteHost" querystring:"WebsiteHost"`
// Enable virus checking or not. 1 to enable
Virus int `json:"Virus" querystring:"Virus"`
// Use to specify the expected Final URL in the testing process
FinalEndpoint string `json:"FinalEndpoint" querystring:"FinalEndpoint"`
+ // Use to enable SSL validation
+ EnableSSLAlert bool `json:"EnableSSLAlert" querystring:"EnableSSLAlert"`
+
// Use to specify whether redirects should be followed
FollowRedirect bool `json:"FollowRedirect" querystring:"FollowRedirect"`
}
e["FinalEndpoint"] = "must be a Valid URL"
}
- var jsonVerifiable map[string]interface{}
- if json.Unmarshal([]byte(t.CustomHeader), &jsonVerifiable) != nil {
- e["CustomHeader"] = "must be provided as json string"
+ if t.CustomHeader != "" {
+ var jsonVerifiable map[string]interface{}
+ if json.Unmarshal([]byte(t.CustomHeader), &jsonVerifiable) != nil {
+ e["CustomHeader"] = "must be provided as json string"
+ }
}
if len(e) > 0 {
// Tests is a client that implements the `Tests` API.
type Tests interface {
All() ([]*Test, error)
+ AllWithFilter(url.Values) ([]*Test, error)
Detail(int) (*Test, error)
Update(*Test) (*Test, error)
Delete(TestID int) error
return tests, err
}
+func (tt *tests) AllWithFilter(filterOptions url.Values) ([]*Test, error) {
+ resp, err := tt.client.get("/Tests", filterOptions)
+ if err != nil {
+ return nil, err
+ }
+ defer resp.Body.Close()
+
+ var tests []*Test
+ err = json.NewDecoder(resp.Body).Decode(&tests)
+
+ return tests, err
+}
+
func (tt *tests) Update(t *Test) (*Test, error) {
resp, err := tt.client.put("/Tests/Update", t.ToURLValues())
if err != nil {
cloud.google.com/go/internal/trace
cloud.google.com/go/internal/version
cloud.google.com/go/compute/metadata
-# github.com/DreamItGetIT/statuscake v0.0.0-20180728152938-85edefcbdaa3
+# github.com/DreamItGetIT/statuscake v0.0.0-20190218105717-471b24d8edfb
github.com/DreamItGetIT/statuscake
# github.com/agext/levenshtein v1.2.2
github.com/agext/levenshtein