- Notifications
You must be signed in to change notification settings - Fork 147
/
Copy pathorg_team.go
25 lines (20 loc) · 763 Bytes
/
org_team.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// 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
import"fmt"
typeTeamstruct {
IDint64`json:"id"`
Namestring`json:"name"`
Descriptionstring`json:"description"`
Permissionstring`json:"permission"`
}
typeCreateTeamOptionstruct {
Namestring`json:"name" binding:"Required;AlphaDashDot;MaxSize(30)"`
Descriptionstring`json:"description" binding:"MaxSize(255)"`
Permissionstring`json:"permission"`
}
func (c*Client) ListTeams(namestring) ([]*Team, error) {
teams:=make([]*Team, 0, 5)
returnteams, c.getParsedResponse("GET", fmt.Sprintf("/orgs/%s/teams", name), nil, nil, &teams)
}