diff --git a/admin_orgs.go b/admin_org.go similarity index 70% rename from admin_orgs.go rename to admin_org.go index ee29464..92f2cd9 100644 --- a/admin_orgs.go +++ b/admin_org.go @@ -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 { diff --git a/admin_repos.go b/admin_repo.go similarity index 100% rename from admin_repos.go rename to admin_repo.go diff --git a/admin_users.go b/admin_user.go similarity index 100% rename from admin_users.go rename to admin_user.go diff --git a/gogs.go b/gogs.go index 8e4596b..ce9e0a2 100644 --- a/gogs.go +++ b/gogs.go @@ -14,7 +14,7 @@ import ( ) func Version() string { - return "0.8.0" + return "0.8.1" } // Client represents a Gogs API client. diff --git a/org.go b/org.go index 4d31461..a68462d 100644 --- a/org.go +++ b/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"` diff --git a/org_team.go b/org_team.go new file mode 100644 index 0000000..89f09e3 --- /dev/null +++ b/org_team.go @@ -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"` +} diff --git a/repo_hooks.go b/repo_hook.go similarity index 100% rename from repo_hooks.go rename to repo_hook.go diff --git a/repo_keys.go b/repo_key.go similarity index 100% rename from repo_keys.go rename to repo_key.go diff --git a/user_keys.go b/user_key.go similarity index 100% rename from user_keys.go rename to user_key.go