From 163245446e18f683acc825a507416830a85a4527 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Sat, 23 Feb 2019 08:58:12 +0000 Subject: [PATCH 1/6] Set new HttpClient via cleanhttp --- client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index d2d1266..f152fe9 100644 --- a/client.go +++ b/client.go @@ -10,6 +10,8 @@ import ( "os" "path" "strings" + + "github.com/hashicorp/go-cleanhttp" ) type Client struct { @@ -35,7 +37,7 @@ func New(auth, baseURL string) (*Client, error) { return &Client{ key, *u, - &http.Client{}, + cleanhttp.DefaultClient(), }, nil } From aa8a8bed7e91b6b11c837aae366bc3be68795745 Mon Sep 17 00:00:00 2001 From: Malcolm Jones Date: Wed, 16 Oct 2019 22:33:05 -0400 Subject: [PATCH 2/6] .drone.yml and build status --- .drone.yml | 10 ++++++++++ README.md | 2 ++ 2 files changed, 12 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..1f15350 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,10 @@ +--- +kind: pipeline +type: docker +name: default + +steps: +- name: test + image: golang + commands: + - go test diff --git a/README.md b/README.md index 581af01..18f7314 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # grafana-api-golang-client +[![Build Status](https://cloud.drone.io/api/badges/nytm/go-grafana-api/status.svg)](https://cloud.drone.io/nytm/go-grafana-api) + Grafana HTTP API Client for Go ## Tests From 70bc6f489393d53a53acfa2add6269768cc8e62a Mon Sep 17 00:00:00 2001 From: Malcolm Jones Date: Wed, 16 Oct 2019 22:34:54 -0400 Subject: [PATCH 3/6] add go get --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index 1f15350..7d5af83 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,4 +7,5 @@ steps: - name: test image: golang commands: + - go get ./... - go test From 4e2984f15f04f3b27055fd21cfbcdd9731d66308 Mon Sep 17 00:00:00 2001 From: Malcolm Jones Date: Wed, 16 Oct 2019 22:35:54 -0400 Subject: [PATCH 4/6] add test deps --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 7d5af83..089e615 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,5 +7,5 @@ steps: - name: test image: golang commands: - - go get ./... + - go get -t ./... - go test From 820b8eae125fdd56ad88899d9a6f186ab5e2192d Mon Sep 17 00:00:00 2001 From: Malcolm Jones Date: Wed, 16 Oct 2019 23:40:14 -0400 Subject: [PATCH 5/6] go mod --- go.mod | 8 ++++++++ go.sum | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 go.mod create mode 100644 go.sum diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f2ff8a8 --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module github.com/nytm/go-grafana-api + +go 1.12 + +require ( + github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b + github.com/hashicorp/go-cleanhttp v0.5.1 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..a0633e9 --- /dev/null +++ b/go.sum @@ -0,0 +1,4 @@ +github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b h1:/vQ+oYKu+JoyaMPDsv5FzwuL2wwWBgBbtj/YLCi4LuA= +github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b/go.mod h1:Xo4aNUOrJnVruqWQJBtW6+bTBDTniY8yZum5rF3b5jw= +github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= From 560cc5c2f6b39bcf00aafd20af7123ef5208e20e Mon Sep 17 00:00:00 2001 From: Malcolm Jones Date: Wed, 16 Oct 2019 23:43:38 -0400 Subject: [PATCH 6/6] mod download --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 089e615..7f493bc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,5 +7,5 @@ steps: - name: test image: golang commands: - - go get -t ./... + - go mod download - go test