forked from gitea/gitea
Update gitea/sdk vendor (#406)
This commit is contained in:
parent
578a8e258e
commit
b11843b8dc
|
@ -18,3 +18,10 @@ type CreateTeamOption struct {
|
||||||
Description string `json:"description" binding:"MaxSize(255)"`
|
Description string `json:"description" binding:"MaxSize(255)"`
|
||||||
Permission string `json:"permission"`
|
Permission string `json:"permission"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EditTeamOption options when edit team
|
||||||
|
type EditTeamOption struct {
|
||||||
|
Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(30)"`
|
||||||
|
Description string `json:"description" binding:"MaxSize(255)"`
|
||||||
|
Permission string `json:"permission"`
|
||||||
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
package gitea
|
package gitea
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -17,6 +18,16 @@ type User struct {
|
||||||
AvatarURL string `json:"avatar_url"`
|
AvatarURL string `json:"avatar_url"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MarshalJSON implements the json.Marshaler interface for User, adding field(s) for backward compatibility
|
||||||
|
func (u User) MarshalJSON() ([]byte, error) {
|
||||||
|
// Re-declaring User to avoid recursion
|
||||||
|
type shadow User
|
||||||
|
return json.Marshal(struct {
|
||||||
|
shadow
|
||||||
|
CompatUserName string `json:"username"`
|
||||||
|
}{shadow(u), u.UserName})
|
||||||
|
}
|
||||||
|
|
||||||
// GetUserInfo get user info by user's name
|
// GetUserInfo get user info by user's name
|
||||||
func (c *Client) GetUserInfo(user string) (*User, error) {
|
func (c *Client) GetUserInfo(user string) (*User, error) {
|
||||||
u := new(User)
|
u := new(User)
|
||||||
|
|
|
@ -9,10 +9,10 @@
|
||||||
"revisionTime": "2016-11-13T14:20:52Z"
|
"revisionTime": "2016-11-13T14:20:52Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "x5jr5+UwaMg861XyFWIoNzYmmMM=",
|
"checksumSHA1": "KZEYDYPzVc12f0770V++kIHhfa0=",
|
||||||
"path": "code.gitea.io/sdk/gitea",
|
"path": "code.gitea.io/sdk/gitea",
|
||||||
"revision": "140df7f34c05d0d7e5b03c2b4a7d38690b3a5152",
|
"revision": "76837c0ea4b9b9a011e7bb04d79e3d20caf1a45c",
|
||||||
"revisionTime": "2016-11-29T07:37:12Z"
|
"revisionTime": "2016-12-15T16:13:48Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "IyfS7Rbl6OgR83QR7TOfKdDCq+M=",
|
"checksumSHA1": "IyfS7Rbl6OgR83QR7TOfKdDCq+M=",
|
||||||
|
|
Loading…
Reference in New Issue