1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-06 03:27:27 +00:00

Make ExecRouteAgainst to work better and fix gorillamux and httprouter, remove of contextlinker policy it's useless now

Former-commit-id: 8d3501e6c490d630d3a4bec0c077dcd7d532242f
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-02-18 07:03:37 +02:00
parent ab63ebcfa5
commit 7263649002
10 changed files with 194 additions and 99 deletions

View File

@@ -272,11 +272,6 @@ type (
// URLPath used for reverse routing on templates with {{ url }} and {{ path }} funcs.
// Receives the route name and arguments and returns its http path
URLPath func(r RouteInfo, args ...string) string
// RouteContextLinker should put the route's handlers and named parameters(if any) to the ctx
// it's used to execute virtually an "offline" route
// against a context like it was requested by user, but it is not.
RouteContextLinker func(r RouteInfo, ctx *Context)
}
// RouterBuilderPolicy is the most useful Policy for custom routers.
// A custom router should adapt this policy which is a func
@@ -317,10 +312,6 @@ func (r RouterReversionPolicy) Adapt(frame *Policies) {
if r.URLPath != nil {
frame.RouterReversionPolicy.URLPath = r.URLPath
}
if r.RouteContextLinker != nil {
frame.RouterReversionPolicy.RouteContextLinker = r.RouteContextLinker
}
}
// Adapt adaps a RouterBuilderPolicy object to the main *Policies.