]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/commitdiff
Update client dependency
authorIvan Schwarz <ivos.schwarz@gmail.com>
Fri, 14 Jun 2019 13:41:14 +0000 (15:41 +0200)
committerIvan Schwarz <ivos.schwarz@gmail.com>
Fri, 14 Jun 2019 13:41:14 +0000 (15:41 +0200)
12 files changed:
go.mod
go.sum
vendor/github.com/DreamItGetIT/statuscake/.gitignore [new file with mode: 0644]
vendor/github.com/DreamItGetIT/statuscake/.travis.yml [new file with mode: 0644]
vendor/github.com/DreamItGetIT/statuscake/Gopkg.lock [new file with mode: 0644]
vendor/github.com/DreamItGetIT/statuscake/Gopkg.toml [new file with mode: 0644]
vendor/github.com/DreamItGetIT/statuscake/README.md
vendor/github.com/DreamItGetIT/statuscake/doc.go
vendor/github.com/DreamItGetIT/statuscake/makefile
vendor/github.com/DreamItGetIT/statuscake/responses.go
vendor/github.com/DreamItGetIT/statuscake/tests.go
vendor/modules.txt

diff --git a/go.mod b/go.mod
index 5374fe21b934fe29489fd10d8820ef101fe7cdcc..d9992469d3071ec6bfa2409dd77e37fe253659da 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
 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
 )
diff --git a/go.sum b/go.sum
index 769c88e74f7293ff714608df6b5587b0e862909a..cc8f846a576f52a7718e2373a055b978471381e8 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -17,8 +17,8 @@ github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzS
 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=
diff --git a/vendor/github.com/DreamItGetIT/statuscake/.gitignore b/vendor/github.com/DreamItGetIT/statuscake/.gitignore
new file mode 100644 (file)
index 0000000..22d0d82
--- /dev/null
@@ -0,0 +1 @@
+vendor
diff --git a/vendor/github.com/DreamItGetIT/statuscake/.travis.yml b/vendor/github.com/DreamItGetIT/statuscake/.travis.yml
new file mode 100644 (file)
index 0000000..c7bad4e
--- /dev/null
@@ -0,0 +1,14 @@
+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
diff --git a/vendor/github.com/DreamItGetIT/statuscake/Gopkg.lock b/vendor/github.com/DreamItGetIT/statuscake/Gopkg.lock
new file mode 100644 (file)
index 0000000..c5b189e
--- /dev/null
@@ -0,0 +1,48 @@
+# 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
diff --git a/vendor/github.com/DreamItGetIT/statuscake/Gopkg.toml b/vendor/github.com/DreamItGetIT/statuscake/Gopkg.toml
new file mode 100644 (file)
index 0000000..b0c1687
--- /dev/null
@@ -0,0 +1,38 @@
+# 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
index f1e4eafc7d68e6512f90cff8f686cd63c63442ea..0806028cdae6fc19596c2ff4b5c037de52f2f845 100644 (file)
@@ -1,5 +1,7 @@
 # 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).
index fa68d94b8a36a4092df3e26b54a47828bc0a68cf..d45680eb714247c4dde40e9bcddf4ad64bb0f8e7 100644 (file)
 //    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
index 946f6d993e5d7026f4c329342481e952284f5e64..6149bbfd5dde678b1d921daf704d0330358ab273 100644 (file)
@@ -1,6 +1,6 @@
-.PHONY: default lint test
+.PHONY: default deps lint test
 
-default: lint test
+default: deps lint test
 
 lint:
        @golint ./...
@@ -9,3 +9,5 @@ lint:
 test:
        go test ${GOTEST_ARGS} ./...
 
+deps:
+       dep ensure
\ No newline at end of file
index e8d4af4a476dab33a68528da936040ddccda1ad8..ec74a63853ce24924bfbee2081d98028053f46cc 100644 (file)
@@ -61,6 +61,7 @@ type detailResponse struct {
        UseJar          int                          `json:"UseJar"`
        PostRaw         string                       `json:"PostRaw"`
        FinalEndpoint   string                       `json:"FinalEndpoint"`
+       EnableSSLWarning  bool                       `json:"EnableSSLWarning"`
        FollowRedirect  bool                         `json:"FollowRedirect"`
        StatusCodes     []string                     `json:"StatusCodes"`
 }
@@ -96,6 +97,7 @@ func (d *detailResponse) test() *Test {
                UseJar:         d.UseJar,
                PostRaw:        d.PostRaw,
                FinalEndpoint:  d.FinalEndpoint,
+               EnableSSLAlert: d.EnableSSLWarning,
                FollowRedirect: d.FollowRedirect,
                StatusCodes:    strings.Join(d.StatusCodes[:], ","),
        }
index c6e6dd2d14f4e1ea309dfecda5bf696403ba177c..2a2383d550be493609a5c9f5d5da0b2177ccdaed 100644 (file)
@@ -42,7 +42,7 @@ type Test struct {
        // 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)
@@ -75,7 +75,7 @@ type Test struct {
        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"`
@@ -110,6 +110,9 @@ type Test struct {
        // 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"`
 }
@@ -166,9 +169,11 @@ func (t *Test) Validate() error {
                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 {
@@ -244,6 +249,7 @@ func valueToQueryStringValue(v reflect.Value) string {
 // 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
@@ -272,6 +278,19 @@ func (tt *tests) All() ([]*Test, 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 {
index e083517760c4dc07bb9e1b54c9a46dae88445445..b1009a70de7b6e502d9196234bbd775adbb04ba8 100644 (file)
@@ -6,7 +6,7 @@ cloud.google.com/go/internal/optional
 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