Refactoring: rename package routers -> routes

This commit is contained in:
Unknwon 2017-06-11 00:34:14 -04:00
parent 6197a7639a
commit 4400d2fdd9
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
62 changed files with 51 additions and 51 deletions

View File

@ -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 (

View File

@ -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 (

View File

@ -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") {

View File

@ -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

View File

@ -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,

View File

@ -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,

View File

@ -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

View File

@ -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) {

View File

@ -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

View File

@ -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) {

View File

@ -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 {

View File

@ -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) {

View File

@ -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) {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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 (

View File

@ -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"

View File

@ -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 (

View File

@ -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 (

View File

@ -1 +1 @@
0.11.19.0609 0.11.19.0611