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/pkg/httplib"
"github.com/gogits/gogs/pkg/setting"
http "github.com/gogits/gogs/routers/repo"
http "github.com/gogits/gogs/routes/repo"
)
var (

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1 +1 @@
0.11.19.0609
0.11.19.0611