diff options
Diffstat (limited to 'vendor/code.gitea.io/sdk/gitea/gitea.go')
-rw-r--r-- | vendor/code.gitea.io/sdk/gitea/gitea.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/code.gitea.io/sdk/gitea/gitea.go b/vendor/code.gitea.io/sdk/gitea/gitea.go index 0a6bf4d749..20cb44feed 100644 --- a/vendor/code.gitea.io/sdk/gitea/gitea.go +++ b/vendor/code.gitea.io/sdk/gitea/gitea.go @@ -13,6 +13,7 @@ import ( "strings" ) +// Version return the library version func Version() string { return "0.12.3" } @@ -88,3 +89,13 @@ func (c *Client) getParsedResponse(method, path string, header http.Header, body } return json.Unmarshal(data, obj) } + +func (c *Client) getStatusCode(method, path string, header http.Header, body io.Reader) (int, error) { + resp, err := c.doRequest(method, path, header, body) + if err != nil { + return -1, err + } + defer resp.Body.Close() + + return resp.StatusCode, nil +} |