Skip to content

Commit 1da1834

Browse files
committed
Add CreateTeamOption
1 parent 788ec59 commit 1da1834

9 files changed

+27
-9
lines changed

admin_orgs.go renamed to admin_org.go

-8
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ import (
1111
"net/http"
1212
)
1313

14-
type CreateOrgOption struct {
15-
UserName string `json:"username" binding:"Required"`
16-
FullName string `json:"full_name"`
17-
Description string `json:"description"`
18-
Website string `json:"website"`
19-
Location string `json:"location"`
20-
}
21-
2214
func (c *Client) AdminCreateOrg(user string, opt CreateOrgOption) (*Organization, error) {
2315
body, err := json.Marshal(&opt)
2416
if err != nil {
File renamed without changes.
File renamed without changes.

gogs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
func Version() string {
17-
return "0.8.0"
17+
return "0.8.1"
1818
}
1919

2020
// Client represents a Gogs API client.

org.go

+8
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ func (c *Client) GetOrg(orgname string) (*Organization, error) {
3636
return org, c.getParsedResponse("GET", fmt.Sprintf("/orgs/%s", orgname), nil, nil, org)
3737
}
3838

39+
type CreateOrgOption struct {
40+
UserName string `json:"username" binding:"Required"`
41+
FullName string `json:"full_name"`
42+
Description string `json:"description"`
43+
Website string `json:"website"`
44+
Location string `json:"location"`
45+
}
46+
3947
type EditOrgOption struct {
4048
FullName string `json:"full_name"`
4149
Description string `json:"description"`

org_team.go

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2016 The Gogs Authors. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
package gogs
6+
7+
type Team struct {
8+
ID int64 `json:"id"`
9+
Name string `json:"name"`
10+
Description string `json:"description"`
11+
Permission string `json:"permission"`
12+
}
13+
14+
type CreateTeamOption struct {
15+
Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(30)"`
16+
Description string `json:"description" binding:"MaxSize(255)"`
17+
Permission string `json:"permission"`
18+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)