summaryrefslogtreecommitdiffstats
path: root/vendor/code.gitea.io
diff options
context:
space:
mode:
authorMartin Hebnes Pedersen <martin.h.pedersen@gmail.com>2016-12-16 16:26:35 +0100
committerThomas Boerger <thomas@webhippie.de>2016-12-16 16:26:35 +0100
commitb11843b8dc811fa0cedd968f7c337e5d14ab9492 (patch)
tree375ba30bad3d89308290d078beae2d5b2648b1ee /vendor/code.gitea.io
parent578a8e258e4a36ed439ad0fd2c1ea45a0ec21f7c (diff)
downloadgitea-b11843b8dc811fa0cedd968f7c337e5d14ab9492.tar.gz
gitea-b11843b8dc811fa0cedd968f7c337e5d14ab9492.zip
Update gitea/sdk vendor (#406)
Diffstat (limited to 'vendor/code.gitea.io')
-rw-r--r--vendor/code.gitea.io/sdk/gitea/org_team.go7
-rw-r--r--vendor/code.gitea.io/sdk/gitea/user.go11
2 files changed, 18 insertions, 0 deletions
diff --git a/vendor/code.gitea.io/sdk/gitea/org_team.go b/vendor/code.gitea.io/sdk/gitea/org_team.go
index a94a43f6de..eddaa2d60e 100644
--- a/vendor/code.gitea.io/sdk/gitea/org_team.go
+++ b/vendor/code.gitea.io/sdk/gitea/org_team.go
@@ -18,3 +18,10 @@ type CreateTeamOption struct {
Description string `json:"description" binding:"MaxSize(255)"`
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"`
+}
diff --git a/vendor/code.gitea.io/sdk/gitea/user.go b/vendor/code.gitea.io/sdk/gitea/user.go
index 2560d85cb8..967d8b5154 100644
--- a/vendor/code.gitea.io/sdk/gitea/user.go
+++ b/vendor/code.gitea.io/sdk/gitea/user.go
@@ -5,6 +5,7 @@
package gitea
import (
+ "encoding/json"
"fmt"
)
@@ -17,6 +18,16 @@ type User struct {
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
func (c *Client) GetUserInfo(user string) (*User, error) {
u := new(User)