]> source.dussan.org Git - gitea.git/commit
Refactor routers directory (#15800)
authorLunny Xiao <xiaolunwen@gmail.com>
Tue, 8 Jun 2021 23:33:54 +0000 (07:33 +0800)
committerGitHub <noreply@github.com>
Tue, 8 Jun 2021 23:33:54 +0000 (01:33 +0200)
commit1bfb0a24d843e10d6d95c4319a84980485e584ed
treee4a736f9abee3eaad1270bf3b60ee3bb9401a9dc
parente03a91a48ef7fb716cc7c8bfb411ca8f332dcfe5
Refactor routers directory (#15800)

* refactor routers directory

* move func used for web and api to common

* make corsHandler a function to prohibit side efects

* rm unused func

Co-authored-by: 6543 <6543@obermui.de>
195 files changed:
.golangci.yml
cmd/web.go
contrib/pr/checkout.go
integrations/create_no_session_test.go
integrations/integration_test.go
integrations/lfs_getobject_test.go
routers/admin/admin.go [deleted file]
routers/admin/admin_test.go [deleted file]
routers/admin/auths.go [deleted file]
routers/admin/emails.go [deleted file]
routers/admin/hooks.go [deleted file]
routers/admin/main_test.go [deleted file]
routers/admin/notice.go [deleted file]
routers/admin/orgs.go [deleted file]
routers/admin/repos.go [deleted file]
routers/admin/users.go [deleted file]
routers/admin/users_test.go [deleted file]
routers/api/v1/repo/file.go
routers/common/db.go [new file with mode: 0644]
routers/common/logger.go [new file with mode: 0644]
routers/common/middleware.go [new file with mode: 0644]
routers/common/repo.go [new file with mode: 0644]
routers/dev/template.go [deleted file]
routers/events/events.go [deleted file]
routers/home.go [deleted file]
routers/init.go
routers/install.go [deleted file]
routers/install/install.go [new file with mode: 0644]
routers/install/routes.go [new file with mode: 0644]
routers/install/setting.go [new file with mode: 0644]
routers/metrics.go [deleted file]
routers/org/home.go [deleted file]
routers/org/members.go [deleted file]
routers/org/org.go [deleted file]
routers/org/org_labels.go [deleted file]
routers/org/setting.go [deleted file]
routers/org/teams.go [deleted file]
routers/repo/activity.go [deleted file]
routers/repo/attachment.go [deleted file]
routers/repo/blame.go [deleted file]
routers/repo/branch.go [deleted file]
routers/repo/commit.go [deleted file]
routers/repo/compare.go [deleted file]
routers/repo/download.go [deleted file]
routers/repo/editor.go [deleted file]
routers/repo/editor_test.go [deleted file]
routers/repo/http.go [deleted file]
routers/repo/issue.go [deleted file]
routers/repo/issue_dependency.go [deleted file]
routers/repo/issue_label.go [deleted file]
routers/repo/issue_label_test.go [deleted file]
routers/repo/issue_lock.go [deleted file]
routers/repo/issue_stopwatch.go [deleted file]
routers/repo/issue_test.go [deleted file]
routers/repo/issue_timetrack.go [deleted file]
routers/repo/issue_watch.go [deleted file]
routers/repo/lfs.go [deleted file]
routers/repo/main_test.go [deleted file]
routers/repo/middlewares.go [deleted file]
routers/repo/migrate.go [deleted file]
routers/repo/milestone.go [deleted file]
routers/repo/projects.go [deleted file]
routers/repo/projects_test.go [deleted file]
routers/repo/pull.go [deleted file]
routers/repo/pull_review.go [deleted file]
routers/repo/release.go [deleted file]
routers/repo/release_test.go [deleted file]
routers/repo/repo.go [deleted file]
routers/repo/search.go [deleted file]
routers/repo/setting.go [deleted file]
routers/repo/setting_protected_branch.go [deleted file]
routers/repo/settings_test.go [deleted file]
routers/repo/topic.go [deleted file]
routers/repo/view.go [deleted file]
routers/repo/webhook.go [deleted file]
routers/repo/wiki.go [deleted file]
routers/repo/wiki_test.go [deleted file]
routers/routes/base.go [deleted file]
routers/routes/goget.go [deleted file]
routers/routes/install.go [deleted file]
routers/routes/web.go [deleted file]
routers/swagger_json.go [deleted file]
routers/user/auth.go [deleted file]
routers/user/auth_openid.go [deleted file]
routers/user/avatar.go [deleted file]
routers/user/home.go [deleted file]
routers/user/home_test.go [deleted file]
routers/user/main_test.go [deleted file]
routers/user/notification.go [deleted file]
routers/user/oauth.go [deleted file]
routers/user/profile.go [deleted file]
routers/user/setting/account.go [deleted file]
routers/user/setting/account_test.go [deleted file]
routers/user/setting/adopt.go [deleted file]
routers/user/setting/applications.go [deleted file]
routers/user/setting/keys.go [deleted file]
routers/user/setting/main_test.go [deleted file]
routers/user/setting/oauth2.go [deleted file]
routers/user/setting/profile.go [deleted file]
routers/user/setting/security.go [deleted file]
routers/user/setting/security_openid.go [deleted file]
routers/user/setting/security_twofa.go [deleted file]
routers/user/setting/security_u2f.go [deleted file]
routers/user/task.go [deleted file]
routers/web/admin/admin.go [new file with mode: 0644]
routers/web/admin/admin_test.go [new file with mode: 0644]
routers/web/admin/auths.go [new file with mode: 0644]
routers/web/admin/emails.go [new file with mode: 0644]
routers/web/admin/hooks.go [new file with mode: 0644]
routers/web/admin/main_test.go [new file with mode: 0644]
routers/web/admin/notice.go [new file with mode: 0644]
routers/web/admin/orgs.go [new file with mode: 0644]
routers/web/admin/repos.go [new file with mode: 0644]
routers/web/admin/users.go [new file with mode: 0644]
routers/web/admin/users_test.go [new file with mode: 0644]
routers/web/base.go [new file with mode: 0644]
routers/web/dev/template.go [new file with mode: 0644]
routers/web/events/events.go [new file with mode: 0644]
routers/web/explore/code.go [new file with mode: 0644]
routers/web/explore/org.go [new file with mode: 0644]
routers/web/explore/repo.go [new file with mode: 0644]
routers/web/explore/user.go [new file with mode: 0644]
routers/web/goget.go [new file with mode: 0644]
routers/web/home.go [new file with mode: 0644]
routers/web/metrics.go [new file with mode: 0644]
routers/web/org/home.go [new file with mode: 0644]
routers/web/org/members.go [new file with mode: 0644]
routers/web/org/org.go [new file with mode: 0644]
routers/web/org/org_labels.go [new file with mode: 0644]
routers/web/org/setting.go [new file with mode: 0644]
routers/web/org/teams.go [new file with mode: 0644]
routers/web/repo/activity.go [new file with mode: 0644]
routers/web/repo/attachment.go [new file with mode: 0644]
routers/web/repo/blame.go [new file with mode: 0644]
routers/web/repo/branch.go [new file with mode: 0644]
routers/web/repo/commit.go [new file with mode: 0644]
routers/web/repo/compare.go [new file with mode: 0644]
routers/web/repo/download.go [new file with mode: 0644]
routers/web/repo/editor.go [new file with mode: 0644]
routers/web/repo/editor_test.go [new file with mode: 0644]
routers/web/repo/http.go [new file with mode: 0644]
routers/web/repo/issue.go [new file with mode: 0644]
routers/web/repo/issue_dependency.go [new file with mode: 0644]
routers/web/repo/issue_label.go [new file with mode: 0644]
routers/web/repo/issue_label_test.go [new file with mode: 0644]
routers/web/repo/issue_lock.go [new file with mode: 0644]
routers/web/repo/issue_stopwatch.go [new file with mode: 0644]
routers/web/repo/issue_test.go [new file with mode: 0644]
routers/web/repo/issue_timetrack.go [new file with mode: 0644]
routers/web/repo/issue_watch.go [new file with mode: 0644]
routers/web/repo/lfs.go [new file with mode: 0644]
routers/web/repo/main_test.go [new file with mode: 0644]
routers/web/repo/middlewares.go [new file with mode: 0644]
routers/web/repo/migrate.go [new file with mode: 0644]
routers/web/repo/milestone.go [new file with mode: 0644]
routers/web/repo/projects.go [new file with mode: 0644]
routers/web/repo/projects_test.go [new file with mode: 0644]
routers/web/repo/pull.go [new file with mode: 0644]
routers/web/repo/pull_review.go [new file with mode: 0644]
routers/web/repo/release.go [new file with mode: 0644]
routers/web/repo/release_test.go [new file with mode: 0644]
routers/web/repo/repo.go [new file with mode: 0644]
routers/web/repo/search.go [new file with mode: 0644]
routers/web/repo/setting.go [new file with mode: 0644]
routers/web/repo/setting_protected_branch.go [new file with mode: 0644]
routers/web/repo/settings_test.go [new file with mode: 0644]
routers/web/repo/topic.go [new file with mode: 0644]
routers/web/repo/view.go [new file with mode: 0644]
routers/web/repo/webhook.go [new file with mode: 0644]
routers/web/repo/wiki.go [new file with mode: 0644]
routers/web/repo/wiki_test.go [new file with mode: 0644]
routers/web/swagger_json.go [new file with mode: 0644]
routers/web/user/auth.go [new file with mode: 0644]
routers/web/user/auth_openid.go [new file with mode: 0644]
routers/web/user/avatar.go [new file with mode: 0644]
routers/web/user/home.go [new file with mode: 0644]
routers/web/user/home_test.go [new file with mode: 0644]
routers/web/user/main_test.go [new file with mode: 0644]
routers/web/user/notification.go [new file with mode: 0644]
routers/web/user/oauth.go [new file with mode: 0644]
routers/web/user/profile.go [new file with mode: 0644]
routers/web/user/setting/account.go [new file with mode: 0644]
routers/web/user/setting/account_test.go [new file with mode: 0644]
routers/web/user/setting/adopt.go [new file with mode: 0644]
routers/web/user/setting/applications.go [new file with mode: 0644]
routers/web/user/setting/keys.go [new file with mode: 0644]
routers/web/user/setting/main_test.go [new file with mode: 0644]
routers/web/user/setting/oauth2.go [new file with mode: 0644]
routers/web/user/setting/profile.go [new file with mode: 0644]
routers/web/user/setting/security.go [new file with mode: 0644]
routers/web/user/setting/security_openid.go [new file with mode: 0644]
routers/web/user/setting/security_twofa.go [new file with mode: 0644]
routers/web/user/setting/security_u2f.go [new file with mode: 0644]
routers/web/user/task.go [new file with mode: 0644]
routers/web/web.go [new file with mode: 0644]