mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-16 09:52:17 +08:00
Refactor names (#31405)
This PR only does "renaming": * `Route` should be `Router` (and chi router is also called "router") * `Params` should be `PathParam` (to distingush it from URL query param, and to match `FormString`) * Use lower case for private functions to avoid exposing or abusing
This commit is contained in:
modules
templates
web
routers
api
actions
packages
alpine
api.gocargo
chef
composer
conan
conda
container
cran
debian
generic
goproxy
helm
maven
npm
nuget
pub
pypi
rpm
rubygems
swift
vagrant
v1
admin
api.gomisc
notify
org
repo
action.goblob.gobranch.gocollaborators.gocommits.gocompare.gofile.gogit_hook.gogit_ref.gohook.gohook_test.goissue.goissue_attachment.goissue_comment.goissue_comment_attachment.goissue_dependency.goissue_label.goissue_pin.goissue_reaction.goissue_stopwatch.goissue_subscription.goissue_tracked_time.gokey.golabel.gomilestone.gomirror.gonotes.gopull.gopull_review.gorelease.gorelease_attachment.gorelease_tags.gorepo.gostatus.gotag.goteams.gotopic.gotree.go
shared
user
install
private
web
admin
auth
devtest
explore
feed
githttp.goorg
repo
actions
activity.goattachment.gocherry_pick.gocommit.gocompare.godownload.goeditor_test.gofind.gogithttp.goissue.goissue_dependency.goissue_pin.goissue_timetrack.gomilestone.goprojects.goprojects_test.gopull.gorelease.gorepo.gosetting
view.gowiki_test.goshared
user
web.goservices
context
lfs
repository/files
wiki
tests
@ -14,14 +14,14 @@ const MockAfterMiddlewares = "MockAfterMiddlewares"
|
||||
|
||||
var routeMockPoints = map[string]func(next http.Handler) http.Handler{}
|
||||
|
||||
// RouteMockPoint registers a mock point as a middleware for testing, example:
|
||||
// RouterMockPoint registers a mock point as a middleware for testing, example:
|
||||
//
|
||||
// r.Use(web.RouteMockPoint("my-mock-point-1"))
|
||||
// r.Get("/foo", middleware2, web.RouteMockPoint("my-mock-point-2"), middleware2, handler)
|
||||
// r.Use(web.RouterMockPoint("my-mock-point-1"))
|
||||
// r.Get("/foo", middleware2, web.RouterMockPoint("my-mock-point-2"), middleware2, handler)
|
||||
//
|
||||
// Then use web.RouteMock to mock the route execution.
|
||||
// It only takes effect in testing mode (setting.IsInTesting == true).
|
||||
func RouteMockPoint(pointName string) func(next http.Handler) http.Handler {
|
||||
func RouterMockPoint(pointName string) func(next http.Handler) http.Handler {
|
||||
if !setting.IsInTesting {
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user