diff options
| author | Christine Dodrill <me@christine.website> | 2019-01-29 03:33:27 -0800 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2019-01-29 03:33:27 -0800 |
| commit | 10f1a7ca7bec98cc65e6c65f7126d1e303b98ef6 (patch) | |
| tree | fac969dc194f2e6229653a4dd72fa79e8e330fe1 /web | |
| parent | b395841f422fd9c6e50b4be979da0f308f9499a9 (diff) | |
| download | x-10f1a7ca7bec98cc65e6c65f7126d1e303b98ef6.tar.xz x-10f1a7ca7bec98cc65e6c65f7126d1e303b98ef6.zip | |
GitHub Status API is deprecated :(
Diffstat (limited to 'web')
| -rw-r--r-- | web/ghstat/ghstat.go | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/web/ghstat/ghstat.go b/web/ghstat/ghstat.go deleted file mode 100644 index 8d94214..0000000 --- a/web/ghstat/ghstat.go +++ /dev/null @@ -1,48 +0,0 @@ -// Package ghstat is a set of wrappers for the GitHub Status API. -package ghstat - -import "net/http" - -// Status is the human-readable status for GitHub's platform. -type Status struct { - Status string `json:"status"` - LastUpdated string `json:"last_updated"` -} - -// GitHub status API constants. -const ( - GHStatusAPIRoot = `https://status.github.com/api/` - StatusPath = `status.json` - MessagePath = `last-message.json` -) - -// LastStatus returns a request to the most recent status for GitHub's platform. -func LastStatus() *http.Request { - req, err := http.NewRequest(http.MethodGet, GHStatusAPIRoot+StatusPath, nil) - if err != nil { - panic(err) - } - - req.Header.Set("Accept", "application/json") - - return req -} - -// Message is an individiual human-readable message associated with a status update. -type Message struct { - Status string `json:"status"` - Body string `json:"body"` - CreatedOn string `json:"created_on"` -} - -// LastMessage returns a request to the most recent message for GitHub's platform. -func LastMessage() *http.Request { - req, err := http.NewRequest(http.MethodGet, GHStatusAPIRoot+StatusPath, nil) - if err != nil { - panic(err) - } - - req.Header.Set("Accept", "application/json") - - return req -} |
