mirror of
https://github.com/weaveworks/scope.git
synced 2026-05-19 23:57:15 +00:00
Update GOSHOUT package used in example
This commit is contained in:
9
vendor/github.com/richo/GOSHOUT/SHOUT.go
generated
vendored
9
vendor/github.com/richo/GOSHOUT/SHOUT.go
generated
vendored
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user