Update GOSHOUT package used in example

This commit is contained in:
Bryan Boreham
2021-03-17 10:15:09 +00:00
parent b321f1c1e3
commit ca9e28e730
4 changed files with 12 additions and 3 deletions

2
go.mod
View File

@@ -59,7 +59,7 @@ require (
github.com/peterbourgon/runsvinit v2.0.0+incompatible
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v1.5.0
github.com/richo/GOSHOUT v0.0.0-20160308183402-8e98c504bfae
github.com/richo/GOSHOUT v0.0.0-20210103052837-9a2e452d4c18
github.com/russross/blackfriday v0.0.0-20151020174500-a18a46c9b943 // indirect
github.com/shurcooL/sanitized_anchor_name v0.0.0-20150822220530-244f5ac324cb // indirect
github.com/sirupsen/logrus v1.4.2

2
go.sum
View File

@@ -272,6 +272,8 @@ github.com/richo/GOSHOUT v0.0.0-20160308183402-8e98c504bfae h1:/NoALPFmRKJ/attvO
github.com/richo/GOSHOUT v0.0.0-20160308183402-8e98c504bfae/go.mod h1:MSTsYcO3SGF1j/eewqZORAzbp3BUbisi2094EDP3+To=
github.com/richo/GOSHOUT v0.0.0-20190205170632-a1a6db7f26e9 h1:2bCoptIvAKQ1O70dbwQHob8Pop8zIXJHlnVLRtf9pG8=
github.com/richo/GOSHOUT v0.0.0-20190205170632-a1a6db7f26e9/go.mod h1:MSTsYcO3SGF1j/eewqZORAzbp3BUbisi2094EDP3+To=
github.com/richo/GOSHOUT v0.0.0-20210103052837-9a2e452d4c18 h1:3h7KgFHe28S3Vq3A7i37bWUAD8lTryE/C6CXQTgVbo8=
github.com/richo/GOSHOUT v0.0.0-20210103052837-9a2e452d4c18/go.mod h1:MSTsYcO3SGF1j/eewqZORAzbp3BUbisi2094EDP3+To=
github.com/russross/blackfriday v0.0.0-20151020174500-a18a46c9b943 h1:Bn2ofKCNwK+UtM3PAsMzGGaxgViklwyVrl1cyzsHHGc=
github.com/russross/blackfriday v0.0.0-20151020174500-a18a46c9b943/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/sercand/kuberesolver v2.1.0+incompatible/go.mod h1:lWF3GL0xptCB/vCiJPl/ZshwPsX/n4Y7u0CW9E7aQIQ=

View File

@@ -6,6 +6,7 @@ import (
"errors"
"io/ioutil"
"net/http"
"time"
)
type SHOUTREQUEST struct {
@@ -25,13 +26,19 @@ func UPCASE(THING_TO_YELL string) (string, error) {
}
READER := bytes.NewReader(ENCODED)
CLIENT := &http.Client{
Timeout:time.Second * 20,
}
// NO TLS, SO MUCH SADNESS.
RESP, ERR := http.Post("http://API.SHOUTCLOUD.IO/V1/SHOUT",
RESP, ERR := CLIENT.Post("http://API.SHOUTCLOUD.IO/V1/SHOUT",
"application/json", READER)
if ERR != nil {
return "", errors.New("REQUEST FAILED CAN'T UPCASE ERROR MESSAGE HALP")
}
defer RESP.Body.Close()
BODYBYTES, ERR := ioutil.ReadAll(RESP.Body)
if ERR != nil {
return "", errors.New("COULDN'T READ BODY HALP")

2
vendor/modules.txt vendored
View File

@@ -272,7 +272,7 @@ github.com/prometheus/common/model
github.com/prometheus/procfs
github.com/prometheus/procfs/internal/fs
github.com/prometheus/procfs/internal/util
# github.com/richo/GOSHOUT v0.0.0-20160308183402-8e98c504bfae
# github.com/richo/GOSHOUT v0.0.0-20210103052837-9a2e452d4c18
github.com/richo/GOSHOUT
# github.com/russross/blackfriday v0.0.0-20151020174500-a18a46c9b943
github.com/russross/blackfriday