1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-22 20:37:05 +00:00

Build a better web, together!

Former-commit-id: 3cfe87da405d0ff749e1a1010660c556b047f333
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-03-19 03:49:17 +02:00
parent 0733ea37c0
commit 55e1e79816
7 changed files with 514 additions and 1 deletions

22
_future/macros.go Normal file
View File

@@ -0,0 +1,22 @@
package router
/*
TODO:
Here I should think a way to link the framework and user-defined macros
with their one-by-one(?) custom function(s) and all these with one or more PathTmpls or visa-versa
These should be linked at .Boot time, so before the server starts.
Tthe work I have done so far it should be resulted in a single middleware
which will be prepended to the zero position, so no performance cost when no new features are used.
The performance should be the same as now if the path doesn't contains
any macros:
macro = /api/users/{id:int} or /api/users/{id:int range(1,100) !404}
no macro = /api/users/id}).
I should add a good detailed examples on how the user can override or add his/her
own macros and optional functions can be followed (i.e, func = range(1,5)).
Of course no breaking-changes to the user's workflow(I should not and not need to touch the existing router adaptors).
*/