Add CreateTeamOption
This commit is contained in:
parent
788ec59749
commit
1da1834d36
9 changed files with 27 additions and 9 deletions
|
@ -11,14 +11,6 @@ import (
|
|||
"net/http"
|
||||
)
|
||||
|
||||
type CreateOrgOption struct {
|
||||
UserName string `json:"username" binding:"Required"`
|
||||
FullName string `json:"full_name"`
|
||||
Description string `json:"description"`
|
||||
Website string `json:"website"`
|
||||
Location string `json:"location"`
|
||||
}
|
||||
|
||||
func (c *Client) AdminCreateOrg(user string, opt CreateOrgOption) (*Organization, error) {
|
||||
body, err := json.Marshal(&opt)
|
||||
if err != nil {
|
2
gogs.go
2
gogs.go
|
@ -14,7 +14,7 @@ import (
|
|||
)
|
||||
|
||||
func Version() string {
|
||||
return "0.8.0"
|
||||
return "0.8.1"
|
||||
}
|
||||
|
||||
// Client represents a Gogs API client.
|
||||
|
|
8
org.go
8
org.go
|
@ -36,6 +36,14 @@ func (c *Client) GetOrg(orgname string) (*Organization, error) {
|
|||
return org, c.getParsedResponse("GET", fmt.Sprintf("/orgs/%s", orgname), nil, nil, org)
|
||||
}
|
||||
|
||||
type CreateOrgOption struct {
|
||||
UserName string `json:"username" binding:"Required"`
|
||||
FullName string `json:"full_name"`
|
||||
Description string `json:"description"`
|
||||
Website string `json:"website"`
|
||||
Location string `json:"location"`
|
||||
}
|
||||
|
||||
type EditOrgOption struct {
|
||||
FullName string `json:"full_name"`
|
||||
Description string `json:"description"`
|
||||
|
|
18
org_team.go
Normal file
18
org_team.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2016 The Gogs Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package gogs
|
||||
|
||||
type Team struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Permission string `json:"permission"`
|
||||
}
|
||||
|
||||
type CreateTeamOption struct {
|
||||
Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(30)"`
|
||||
Description string `json:"description" binding:"MaxSize(255)"`
|
||||
Permission string `json:"permission"`
|
||||
}
|
Loading…
Reference in a new issue