Browse Source

Refactoring: rename package routers -> routes

pull/4584/head
Unknwon 8 years ago
parent
commit
4400d2fdd9
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 2
      cmd/hook.go
  2. 2
      cmd/serv.go
  3. 30
      cmd/web.go
  4. 2
      gogs.go
  5. 0
      routes/admin/admin.go
  6. 0
      routes/admin/auths.go
  7. 0
      routes/admin/notice.go
  8. 4
      routes/admin/orgs.go
  9. 0
      routes/admin/repos.go
  10. 4
      routes/admin/users.go
  11. 4
      routes/api/v1/admin/org.go
  12. 0
      routes/api/v1/admin/org_repo.go
  13. 4
      routes/api/v1/admin/org_team.go
  14. 4
      routes/api/v1/admin/repo.go
  15. 2
      routes/api/v1/admin/user.go
  16. 10
      routes/api/v1/api.go
  17. 0
      routes/api/v1/convert/convert.go
  18. 0
      routes/api/v1/convert/utils.go
  19. 0
      routes/api/v1/misc/markdown.go
  20. 4
      routes/api/v1/org/org.go
  21. 2
      routes/api/v1/org/team.go
  22. 2
      routes/api/v1/repo/branch.go
  23. 0
      routes/api/v1/repo/collaborators.go
  24. 2
      routes/api/v1/repo/file.go
  25. 2
      routes/api/v1/repo/hook.go
  26. 0
      routes/api/v1/repo/issue.go
  27. 0
      routes/api/v1/repo/issue_comment.go
  28. 0
      routes/api/v1/repo/issue_label.go
  29. 2
      routes/api/v1/repo/key.go
  30. 0
      routes/api/v1/repo/label.go
  31. 0
      routes/api/v1/repo/milestone.go
  32. 2
      routes/api/v1/repo/repo.go
  33. 0
      routes/api/v1/user/app.go
  34. 2
      routes/api/v1/user/email.go
  35. 0
      routes/api/v1/user/follower.go
  36. 4
      routes/api/v1/user/key.go
  37. 0
      routes/api/v1/user/user.go
  38. 0
      routes/dev/template.go
  39. 4
      routes/home.go
  40. 2
      routes/install.go
  41. 0
      routes/org/members.go
  42. 0
      routes/org/org.go
  43. 2
      routes/org/setting.go
  44. 0
      routes/org/teams.go
  45. 0
      routes/repo/branch.go
  46. 0
      routes/repo/commit.go
  47. 0
      routes/repo/download.go
  48. 0
      routes/repo/editor.go
  49. 0
      routes/repo/http.go
  50. 0
      routes/repo/issue.go
  51. 0
      routes/repo/pull.go
  52. 0
      routes/repo/release.go
  53. 0
      routes/repo/repo.go
  54. 0
      routes/repo/setting.go
  55. 0
      routes/repo/view.go
  56. 0
      routes/repo/webhook.go
  57. 0
      routes/repo/wiki.go
  58. 0
      routes/user/auth.go
  59. 0
      routes/user/home.go
  60. 2
      routes/user/profile.go
  61. 0
      routes/user/setting.go
  62. 2
      templates/.VERSION

2
cmd/hook.go

@ -23,7 +23,7 @@ import (
"github.com/gogits/gogs/models" "github.com/gogits/gogs/models"
"github.com/gogits/gogs/pkg/httplib" "github.com/gogits/gogs/pkg/httplib"
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
http "github.com/gogits/gogs/routers/repo" http "github.com/gogits/gogs/routes/repo"
) )
var ( var (

2
cmd/serv.go

@ -19,7 +19,7 @@ import (
"github.com/gogits/gogs/models" "github.com/gogits/gogs/models"
"github.com/gogits/gogs/models/errors" "github.com/gogits/gogs/models/errors"
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
http "github.com/gogits/gogs/routers/repo" http "github.com/gogits/gogs/routes/repo"
) )
const ( const (

30
cmd/web.go

@ -36,13 +36,13 @@ import (
"github.com/gogits/gogs/pkg/mailer" "github.com/gogits/gogs/pkg/mailer"
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
"github.com/gogits/gogs/pkg/template" "github.com/gogits/gogs/pkg/template"
"github.com/gogits/gogs/routers" "github.com/gogits/gogs/routes"
"github.com/gogits/gogs/routers/admin" "github.com/gogits/gogs/routes/admin"
apiv1 "github.com/gogits/gogs/routers/api/v1" apiv1 "github.com/gogits/gogs/routes/api/v1"
"github.com/gogits/gogs/routers/dev" "github.com/gogits/gogs/routes/dev"
"github.com/gogits/gogs/routers/org" "github.com/gogits/gogs/routes/org"
"github.com/gogits/gogs/routers/repo" "github.com/gogits/gogs/routes/repo"
"github.com/gogits/gogs/routers/user" "github.com/gogits/gogs/routes/user"
) )
var Web = cli.Command{ var Web = cli.Command{
@ -160,7 +160,7 @@ func runWeb(c *cli.Context) error {
if c.IsSet("config") { if c.IsSet("config") {
setting.CustomConf = c.String("config") setting.CustomConf = c.String("config")
} }
routers.GlobalInit() routes.GlobalInit()
checkVersion() checkVersion()
m := newMacaron() m := newMacaron()
@ -175,17 +175,17 @@ func runWeb(c *cli.Context) error {
// FIXME: not all routes need go through same middlewares. // FIXME: not all routes need go through same middlewares.
// Especially some AJAX requests, we can reduce middleware number to improve performance. // Especially some AJAX requests, we can reduce middleware number to improve performance.
// Routers. // Routers.
m.Get("/", ignSignIn, routers.Home) m.Get("/", ignSignIn, routes.Home)
m.Group("/explore", func() { m.Group("/explore", func() {
m.Get("", func(c *context.Context) { m.Get("", func(c *context.Context) {
c.Redirect(setting.AppSubURL + "/explore/repos") c.Redirect(setting.AppSubURL + "/explore/repos")
}) })
m.Get("/repos", routers.ExploreRepos) m.Get("/repos", routes.ExploreRepos)
m.Get("/users", routers.ExploreUsers) m.Get("/users", routes.ExploreUsers)
m.Get("/organizations", routers.ExploreOrganizations) m.Get("/organizations", routes.ExploreOrganizations)
}, ignSignIn) }, ignSignIn)
m.Combo("/install", routers.InstallInit).Get(routers.Install). m.Combo("/install", routes.InstallInit).Get(routes.Install).
Post(bindIgnErr(form.Install{}), routers.InstallPost) Post(bindIgnErr(form.Install{}), routes.InstallPost)
m.Get("/^:type(issues|pulls)$", reqSignIn, user.Issues) m.Get("/^:type(issues|pulls)$", reqSignIn, user.Issues)
// ***** START: User ***** // ***** START: User *****
@ -651,7 +651,7 @@ func runWeb(c *cli.Context) error {
}) })
// Not found handler. // Not found handler.
m.NotFound(routers.NotFound) m.NotFound(routes.NotFound)
// Flag for port number in case first time run conflict. // Flag for port number in case first time run conflict.
if c.IsSet("port") { if c.IsSet("port") {

2
gogs.go

@ -16,7 +16,7 @@ import (
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
) )
const APP_VER = "0.11.19.0609" const APP_VER = "0.11.19.0611"
func init() { func init() {
setting.AppVer = APP_VER setting.AppVer = APP_VER

0
routers/admin/admin.go → routes/admin/admin.go

0
routers/admin/auths.go → routes/admin/auths.go

0
routers/admin/notice.go → routes/admin/notice.go

4
routers/admin/orgs.go → routes/admin/orgs.go

@ -8,7 +8,7 @@ import (
"github.com/gogits/gogs/models" "github.com/gogits/gogs/models"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
"github.com/gogits/gogs/routers" "github.com/gogits/gogs/routes"
) )
const ( const (
@ -20,7 +20,7 @@ func Organizations(c *context.Context) {
c.Data["PageIsAdmin"] = true c.Data["PageIsAdmin"] = true
c.Data["PageIsAdminOrganizations"] = true c.Data["PageIsAdminOrganizations"] = true
routers.RenderUserSearch(c, &routers.UserSearchOptions{ routes.RenderUserSearch(c, &routes.UserSearchOptions{
Type: models.USER_TYPE_ORGANIZATION, Type: models.USER_TYPE_ORGANIZATION,
Counter: models.CountOrganizations, Counter: models.CountOrganizations,
Ranger: models.Organizations, Ranger: models.Organizations,

0
routers/admin/repos.go → routes/admin/repos.go

4
routers/admin/users.go → routes/admin/users.go

@ -15,7 +15,7 @@ import (
"github.com/gogits/gogs/pkg/form" "github.com/gogits/gogs/pkg/form"
"github.com/gogits/gogs/pkg/mailer" "github.com/gogits/gogs/pkg/mailer"
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
"github.com/gogits/gogs/routers" "github.com/gogits/gogs/routes"
) )
const ( const (
@ -29,7 +29,7 @@ func Users(c *context.Context) {
c.Data["PageIsAdmin"] = true c.Data["PageIsAdmin"] = true
c.Data["PageIsAdminUsers"] = true c.Data["PageIsAdminUsers"] = true
routers.RenderUserSearch(c, &routers.UserSearchOptions{ routes.RenderUserSearch(c, &routes.UserSearchOptions{
Type: models.USER_TYPE_INDIVIDUAL, Type: models.USER_TYPE_INDIVIDUAL,
Counter: models.CountUsers, Counter: models.CountUsers,
Ranger: models.Users, Ranger: models.Users,

4
routers/api/v1/admin/org.go → routes/api/v1/admin/org.go

@ -9,8 +9,8 @@ import (
"github.com/gogits/gogs/models" "github.com/gogits/gogs/models"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/routers/api/v1/convert" "github.com/gogits/gogs/routes/api/v1/convert"
"github.com/gogits/gogs/routers/api/v1/user" "github.com/gogits/gogs/routes/api/v1/user"
) )
// https://github.com/gogits/go-gogs-client/wiki/Administration-Organizations#create-a-new-organization // https://github.com/gogits/go-gogs-client/wiki/Administration-Organizations#create-a-new-organization

0
routers/api/v1/admin/org_repo.go → routes/api/v1/admin/org_repo.go

4
routers/api/v1/admin/org_team.go → routes/api/v1/admin/org_team.go

@ -9,8 +9,8 @@ import (
"github.com/gogits/gogs/models" "github.com/gogits/gogs/models"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/routers/api/v1/convert" "github.com/gogits/gogs/routes/api/v1/convert"
"github.com/gogits/gogs/routers/api/v1/user" "github.com/gogits/gogs/routes/api/v1/user"
) )
func CreateTeam(c *context.APIContext, form api.CreateTeamOption) { func CreateTeam(c *context.APIContext, form api.CreateTeamOption) {

4
routers/api/v1/admin/repo.go → routes/api/v1/admin/repo.go

@ -8,8 +8,8 @@ import (
api "github.com/gogits/go-gogs-client" api "github.com/gogits/go-gogs-client"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/routers/api/v1/repo" "github.com/gogits/gogs/routes/api/v1/repo"
"github.com/gogits/gogs/routers/api/v1/user" "github.com/gogits/gogs/routes/api/v1/user"
) )
// https://github.com/gogits/go-gogs-client/wiki/Administration-Repositories#create-a-new-repository // https://github.com/gogits/go-gogs-client/wiki/Administration-Repositories#create-a-new-repository

2
routers/api/v1/admin/user.go → routes/api/v1/admin/user.go

@ -13,7 +13,7 @@ import (
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/pkg/mailer" "github.com/gogits/gogs/pkg/mailer"
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
"github.com/gogits/gogs/routers/api/v1/user" "github.com/gogits/gogs/routes/api/v1/user"
) )
func parseLoginSource(c *context.APIContext, u *models.User, sourceID int64, loginName string) { func parseLoginSource(c *context.APIContext, u *models.User, sourceID int64, loginName string) {

10
routers/api/v1/api.go → routes/api/v1/api.go

@ -16,11 +16,11 @@ import (
"github.com/gogits/gogs/models/errors" "github.com/gogits/gogs/models/errors"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/pkg/form" "github.com/gogits/gogs/pkg/form"
"github.com/gogits/gogs/routers/api/v1/admin" "github.com/gogits/gogs/routes/api/v1/admin"
"github.com/gogits/gogs/routers/api/v1/misc" "github.com/gogits/gogs/routes/api/v1/misc"
"github.com/gogits/gogs/routers/api/v1/org" "github.com/gogits/gogs/routes/api/v1/org"
"github.com/gogits/gogs/routers/api/v1/repo" "github.com/gogits/gogs/routes/api/v1/repo"
"github.com/gogits/gogs/routers/api/v1/user" "github.com/gogits/gogs/routes/api/v1/user"
) )
func repoAssignment() macaron.Handler { func repoAssignment() macaron.Handler {

0
routers/api/v1/convert/convert.go → routes/api/v1/convert/convert.go

0
routers/api/v1/convert/utils.go → routes/api/v1/convert/utils.go

0
routers/api/v1/misc/markdown.go → routes/api/v1/misc/markdown.go

4
routers/api/v1/org/org.go → routes/api/v1/org/org.go

@ -9,8 +9,8 @@ import (
"github.com/gogits/gogs/models" "github.com/gogits/gogs/models"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/routers/api/v1/convert" "github.com/gogits/gogs/routes/api/v1/convert"
"github.com/gogits/gogs/routers/api/v1/user" "github.com/gogits/gogs/routes/api/v1/user"
) )
func listUserOrgs(c *context.APIContext, u *models.User, all bool) { func listUserOrgs(c *context.APIContext, u *models.User, all bool) {

2
routers/api/v1/org/team.go → routes/api/v1/org/team.go

@ -8,7 +8,7 @@ import (
api "github.com/gogits/go-gogs-client" api "github.com/gogits/go-gogs-client"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/routers/api/v1/convert" "github.com/gogits/gogs/routes/api/v1/convert"
) )
func ListTeams(c *context.APIContext) { func ListTeams(c *context.APIContext) {

2
routers/api/v1/repo/branch.go → routes/api/v1/repo/branch.go

@ -9,7 +9,7 @@ import (
"github.com/gogits/gogs/models" "github.com/gogits/gogs/models"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/routers/api/v1/convert" "github.com/gogits/gogs/routes/api/v1/convert"
) )
// https://github.com/gogits/go-gogs-client/wiki/Repositories#get-branch // https://github.com/gogits/go-gogs-client/wiki/Repositories#get-branch

0
routers/api/v1/repo/collaborators.go → routes/api/v1/repo/collaborators.go

2
routers/api/v1/repo/file.go → routes/api/v1/repo/file.go

@ -9,7 +9,7 @@ import (
"github.com/gogits/gogs/models" "github.com/gogits/gogs/models"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/routers/repo" "github.com/gogits/gogs/routes/repo"
) )
// https://github.com/gogits/go-gogs-client/wiki/Repositories-Contents#download-raw-content // https://github.com/gogits/go-gogs-client/wiki/Repositories-Contents#download-raw-content

2
routers/api/v1/repo/hook.go → routes/api/v1/repo/hook.go

@ -14,7 +14,7 @@ import (
"github.com/gogits/gogs/models" "github.com/gogits/gogs/models"
"github.com/gogits/gogs/models/errors" "github.com/gogits/gogs/models/errors"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/routers/api/v1/convert" "github.com/gogits/gogs/routes/api/v1/convert"
) )
// https://github.com/gogits/go-gogs-client/wiki/Repositories#list-hooks // https://github.com/gogits/go-gogs-client/wiki/Repositories#list-hooks

0
routers/api/v1/repo/issue.go → routes/api/v1/repo/issue.go

0
routers/api/v1/repo/issue_comment.go → routes/api/v1/repo/issue_comment.go

0
routers/api/v1/repo/issue_label.go → routes/api/v1/repo/issue_label.go

2
routers/api/v1/repo/key.go → routes/api/v1/repo/key.go

@ -12,7 +12,7 @@ import (
"github.com/gogits/gogs/models" "github.com/gogits/gogs/models"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
"github.com/gogits/gogs/routers/api/v1/convert" "github.com/gogits/gogs/routes/api/v1/convert"
) )
func composeDeployKeysAPILink(repoPath string) string { func composeDeployKeysAPILink(repoPath string) string {

0
routers/api/v1/repo/label.go → routes/api/v1/repo/label.go

0
routers/api/v1/repo/milestone.go → routes/api/v1/repo/milestone.go

2
routers/api/v1/repo/repo.go → routes/api/v1/repo/repo.go

@ -16,7 +16,7 @@ import (
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/pkg/form" "github.com/gogits/gogs/pkg/form"
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
"github.com/gogits/gogs/routers/api/v1/convert" "github.com/gogits/gogs/routes/api/v1/convert"
) )
// https://github.com/gogits/go-gogs-client/wiki/Repositories#search-repositories // https://github.com/gogits/go-gogs-client/wiki/Repositories#search-repositories

0
routers/api/v1/user/app.go → routes/api/v1/user/app.go

2
routers/api/v1/user/email.go → routes/api/v1/user/email.go

@ -10,7 +10,7 @@ import (
"github.com/gogits/gogs/models" "github.com/gogits/gogs/models"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
"github.com/gogits/gogs/routers/api/v1/convert" "github.com/gogits/gogs/routes/api/v1/convert"
) )
// https://github.com/gogits/go-gogs-client/wiki/Users-Emails#list-email-addresses-for-a-user // https://github.com/gogits/go-gogs-client/wiki/Users-Emails#list-email-addresses-for-a-user

0
routers/api/v1/user/follower.go → routes/api/v1/user/follower.go

4
routers/api/v1/user/key.go → routes/api/v1/user/key.go

@ -11,8 +11,8 @@ import (
"github.com/gogits/gogs/models/errors" "github.com/gogits/gogs/models/errors"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
"github.com/gogits/gogs/routers/api/v1/convert" "github.com/gogits/gogs/routes/api/v1/convert"
"github.com/gogits/gogs/routers/api/v1/repo" "github.com/gogits/gogs/routes/api/v1/repo"
) )
func GetUserByParamsName(c *context.APIContext, name string) *models.User { func GetUserByParamsName(c *context.APIContext, name string) *models.User {

0
routers/api/v1/user/user.go → routes/api/v1/user/user.go

0
routers/dev/template.go → routes/dev/template.go

4
routers/home.go → routes/home.go

@ -2,7 +2,7 @@
// 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.
package routers package routes
import ( import (
"github.com/Unknwon/paginater" "github.com/Unknwon/paginater"
@ -10,7 +10,7 @@ import (
"github.com/gogits/gogs/models" "github.com/gogits/gogs/models"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
"github.com/gogits/gogs/routers/user" "github.com/gogits/gogs/routes/user"
) )
const ( const (

2
routers/install.go → routes/install.go

@ -2,7 +2,7 @@
// 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.
package routers package routes
import ( import (
"net/mail" "net/mail"

0
routers/org/members.go → routes/org/members.go

0
routers/org/org.go → routes/org/org.go

2
routers/org/setting.go → routes/org/setting.go

@ -14,7 +14,7 @@ import (
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/pkg/form" "github.com/gogits/gogs/pkg/form"
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
"github.com/gogits/gogs/routers/user" "github.com/gogits/gogs/routes/user"
) )
const ( const (

0
routers/org/teams.go → routes/org/teams.go

0
routers/repo/branch.go → routes/repo/branch.go

0
routers/repo/commit.go → routes/repo/commit.go

0
routers/repo/download.go → routes/repo/download.go

0
routers/repo/editor.go → routes/repo/editor.go

0
routers/repo/http.go → routes/repo/http.go

0
routers/repo/issue.go → routes/repo/issue.go

0
routers/repo/pull.go → routes/repo/pull.go

0
routers/repo/release.go → routes/repo/release.go

0
routers/repo/repo.go → routes/repo/repo.go

0
routers/repo/setting.go → routes/repo/setting.go

0
routers/repo/view.go → routes/repo/view.go

0
routers/repo/webhook.go → routes/repo/webhook.go

0
routers/repo/wiki.go → routes/repo/wiki.go

0
routers/user/auth.go → routes/user/auth.go

0
routers/user/home.go → routes/user/home.go

2
routers/user/profile.go → routes/user/profile.go

@ -15,7 +15,7 @@ import (
"github.com/gogits/gogs/models/errors" "github.com/gogits/gogs/models/errors"
"github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
"github.com/gogits/gogs/routers/repo" "github.com/gogits/gogs/routes/repo"
) )
const ( const (

0
routers/user/setting.go → routes/user/setting.go

2
templates/.VERSION

@ -1 +1 @@
0.11.19.0609 0.11.19.0611
Loading…
Cancel
Save