update code.gitea.io/sdk with changes

This commit is contained in:
Gitea 2018-06-21 12:40:23 -04:00
parent 112ec99322
commit b91a9690f6
2 changed files with 8 additions and 2 deletions

2
Gopkg.lock generated
View File

@ -11,7 +11,7 @@
branch = "master"
name = "code.gitea.io/sdk"
packages = ["gitea"]
revision = "b2308e3f700875a3642a78bd3f6e5db8ef6f974d"
revision = "ec80752c9512cf07fc62ddc42565118183743942"
[[projects]]
name = "github.com/PuerkitoBio/goquery"

View File

@ -20,9 +20,9 @@ func BasicAuthEncode(user, pass string) string {
// AccessToken represents a API access token.
// swagger:response AccessToken
type AccessToken struct {
ID int64 `json:"id"`
Name string `json:"name"`
Sha1 string `json:"sha1"`
ID int64 `json:"id"`
}
// AccessTokenList represents a list of API access token.
@ -55,3 +55,9 @@ func (c *Client) CreateAccessToken(user, pass string, opt CreateAccessTokenOptio
"Authorization": []string{"Basic " + BasicAuthEncode(user, pass)}},
bytes.NewReader(body), t)
}
// DeleteAccessToken delete token with key id
func (c *Client) DeleteAccessToken(user string, keyID int64) error {
_, err := c.getResponse("DELETE", fmt.Sprintf("/user/%s/tokens/%d", user, keyID), nil, nil)
return err
}