diff --git a/gitea/admin_org.go b/gitea/admin_org.go index cc25889..1029d49 100644 --- a/gitea/admin_org.go +++ b/gitea/admin_org.go @@ -1,4 +1,5 @@ // 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 // license that can be found in the LICENSE file. @@ -12,6 +13,12 @@ import ( "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 func (c *Client) AdminCreateOrg(user string, opt structs.CreateOrgOption) (*Organization, error) { body, err := json.Marshal(&opt)