Эх сурвалжийг харах

Refactoring: rename package routers -> routes

Unknwon 7 жил өмнө
parent
commit
4400d2fdd9
62 өөрчлөгдсөн 51 нэмэгдсэн , 51 устгасан
  1. 1 1
      cmd/hook.go
  2. 1 1
      cmd/serv.go
  3. 15 15
      cmd/web.go
  4. 1 1
      gogs.go
  5. 0 0
      routes/admin/admin.go
  6. 0 0
      routes/admin/auths.go
  7. 0 0
      routes/admin/notice.go
  8. 2 2
      routes/admin/orgs.go
  9. 0 0
      routes/admin/repos.go
  10. 2 2
      routes/admin/users.go
  11. 2 2
      routes/api/v1/admin/org.go
  12. 0 0
      routes/api/v1/admin/org_repo.go
  13. 2 2
      routes/api/v1/admin/org_team.go
  14. 2 2
      routes/api/v1/admin/repo.go
  15. 1 1
      routes/api/v1/admin/user.go
  16. 5 5
      routes/api/v1/api.go
  17. 0 0
      routes/api/v1/convert/convert.go
  18. 0 0
      routes/api/v1/convert/utils.go
  19. 0 0
      routes/api/v1/misc/markdown.go
  20. 2 2
      routes/api/v1/org/org.go
  21. 1 1
      routes/api/v1/org/team.go
  22. 1 1
      routes/api/v1/repo/branch.go
  23. 0 0
      routes/api/v1/repo/collaborators.go
  24. 1 1
      routes/api/v1/repo/file.go
  25. 1 1
      routes/api/v1/repo/hook.go
  26. 0 0
      routes/api/v1/repo/issue.go
  27. 0 0
      routes/api/v1/repo/issue_comment.go
  28. 0 0
      routes/api/v1/repo/issue_label.go
  29. 1 1
      routes/api/v1/repo/key.go
  30. 0 0
      routes/api/v1/repo/label.go
  31. 0 0
      routes/api/v1/repo/milestone.go
  32. 1 1
      routes/api/v1/repo/repo.go
  33. 0 0
      routes/api/v1/user/app.go
  34. 1 1
      routes/api/v1/user/email.go
  35. 0 0
      routes/api/v1/user/follower.go
  36. 2 2
      routes/api/v1/user/key.go
  37. 0 0
      routes/api/v1/user/user.go
  38. 0 0
      routes/dev/template.go
  39. 2 2
      routes/home.go
  40. 1 1
      routes/install.go
  41. 0 0
      routes/org/members.go
  42. 0 0
      routes/org/org.go
  43. 1 1
      routes/org/setting.go
  44. 0 0
      routes/org/teams.go
  45. 0 0
      routes/repo/branch.go
  46. 0 0
      routes/repo/commit.go
  47. 0 0
      routes/repo/download.go
  48. 0 0
      routes/repo/editor.go
  49. 0 0
      routes/repo/http.go
  50. 0 0
      routes/repo/issue.go
  51. 0 0
      routes/repo/pull.go
  52. 0 0
      routes/repo/release.go
  53. 0 0
      routes/repo/repo.go
  54. 0 0
      routes/repo/setting.go
  55. 0 0
      routes/repo/view.go
  56. 0 0
      routes/repo/webhook.go
  57. 0 0
      routes/repo/wiki.go
  58. 0 0
      routes/user/auth.go
  59. 0 0
      routes/user/home.go
  60. 1 1
      routes/user/profile.go
  61. 0 0
      routes/user/setting.go
  62. 1 1
      templates/.VERSION

+ 1 - 1
cmd/hook.go

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

+ 1 - 1
cmd/serv.go

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

+ 15 - 15
cmd/web.go

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

+ 1 - 1
gogs.go

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

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


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


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


+ 2 - 2
routers/admin/orgs.go → routes/admin/orgs.go

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

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


+ 2 - 2
routers/admin/users.go → routes/admin/users.go

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

+ 2 - 2
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/pkg/context"
-	"github.com/gogits/gogs/routers/api/v1/convert"
-	"github.com/gogits/gogs/routers/api/v1/user"
+	"github.com/gogits/gogs/routes/api/v1/convert"
+	"github.com/gogits/gogs/routes/api/v1/user"
 )
 
 // https://github.com/gogits/go-gogs-client/wiki/Administration-Organizations#create-a-new-organization

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


+ 2 - 2
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/pkg/context"
-	"github.com/gogits/gogs/routers/api/v1/convert"
-	"github.com/gogits/gogs/routers/api/v1/user"
+	"github.com/gogits/gogs/routes/api/v1/convert"
+	"github.com/gogits/gogs/routes/api/v1/user"
 )
 
 func CreateTeam(c *context.APIContext, form api.CreateTeamOption) {

+ 2 - 2
routers/api/v1/admin/repo.go → routes/api/v1/admin/repo.go

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

+ 1 - 1
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/mailer"
 	"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) {

+ 5 - 5
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/pkg/context"
 	"github.com/gogits/gogs/pkg/form"
-	"github.com/gogits/gogs/routers/api/v1/admin"
-	"github.com/gogits/gogs/routers/api/v1/misc"
-	"github.com/gogits/gogs/routers/api/v1/org"
-	"github.com/gogits/gogs/routers/api/v1/repo"
-	"github.com/gogits/gogs/routers/api/v1/user"
+	"github.com/gogits/gogs/routes/api/v1/admin"
+	"github.com/gogits/gogs/routes/api/v1/misc"
+	"github.com/gogits/gogs/routes/api/v1/org"
+	"github.com/gogits/gogs/routes/api/v1/repo"
+	"github.com/gogits/gogs/routes/api/v1/user"
 )
 
 func repoAssignment() macaron.Handler {

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


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


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


+ 2 - 2
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/pkg/context"
-	"github.com/gogits/gogs/routers/api/v1/convert"
-	"github.com/gogits/gogs/routers/api/v1/user"
+	"github.com/gogits/gogs/routes/api/v1/convert"
+	"github.com/gogits/gogs/routes/api/v1/user"
 )
 
 func listUserOrgs(c *context.APIContext, u *models.User, all bool) {

+ 1 - 1
routers/api/v1/org/team.go → routes/api/v1/org/team.go

@@ -8,7 +8,7 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"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) {

+ 1 - 1
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/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

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


+ 1 - 1
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/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

+ 1 - 1
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/errors"
 	"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

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


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


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


+ 1 - 1
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/pkg/context"
 	"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 {

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


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


+ 1 - 1
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/form"
 	"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

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


+ 1 - 1
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/pkg/context"
 	"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

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


+ 2 - 2
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/pkg/context"
 	"github.com/gogits/gogs/pkg/setting"
-	"github.com/gogits/gogs/routers/api/v1/convert"
-	"github.com/gogits/gogs/routers/api/v1/repo"
+	"github.com/gogits/gogs/routes/api/v1/convert"
+	"github.com/gogits/gogs/routes/api/v1/repo"
 )
 
 func GetUserByParamsName(c *context.APIContext, name string) *models.User {

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


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


+ 2 - 2
routers/home.go → routes/home.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a MIT-style
 // license that can be found in the LICENSE file.
 
-package routers
+package routes
 
 import (
 	"github.com/Unknwon/paginater"
@@ -10,7 +10,7 @@ import (
 	"github.com/gogits/gogs/models"
 	"github.com/gogits/gogs/pkg/context"
 	"github.com/gogits/gogs/pkg/setting"
-	"github.com/gogits/gogs/routers/user"
+	"github.com/gogits/gogs/routes/user"
 )
 
 const (

+ 1 - 1
routers/install.go → routes/install.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a MIT-style
 // license that can be found in the LICENSE file.
 
-package routers
+package routes
 
 import (
 	"net/mail"

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


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


+ 1 - 1
routers/org/setting.go → routes/org/setting.go

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

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


+ 1 - 1
routers/user/profile.go → routes/user/profile.go

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

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


+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.11.19.0609
+0.11.19.0611