add AdminListOrgs to list all orgs (#174)
This commit is contained in:
parent
ac88dcdb23
commit
5619ee57ba
1 changed files with 7 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
// Copyright 2015 The Gogs Authors. All rights reserved.
|
// Copyright 2015 The Gogs Authors. All rights reserved.
|
||||||
|
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a MIT-style
|
// Use of this source code is governed by a MIT-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
@ -12,6 +13,12 @@ import (
|
||||||
"code.gitea.io/gitea/modules/structs"
|
"code.gitea.io/gitea/modules/structs"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// AdminListOrgs lists all orgs
|
||||||
|
func (c *Client) AdminListOrgs() ([]*Organization, error) {
|
||||||
|
orgs := make([]*Organization, 0, 10)
|
||||||
|
return orgs, c.getParsedResponse("GET", "/admin/orgs", nil, nil, &orgs)
|
||||||
|
}
|
||||||
|
|
||||||
// AdminCreateOrg create an organization
|
// AdminCreateOrg create an organization
|
||||||
func (c *Client) AdminCreateOrg(user string, opt structs.CreateOrgOption) (*Organization, error) {
|
func (c *Client) AdminCreateOrg(user string, opt structs.CreateOrgOption) (*Organization, error) {
|
||||||
body, err := json.Marshal(&opt)
|
body, err := json.Marshal(&opt)
|
||||||
|
|
Loading…
Reference in a new issue