1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-28 23:37:04 +00:00

Nothing special here (yet)

Former-commit-id: 826d7c370481b78afd9ba92f4ae8bef1fb85a567
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-03-27 04:09:44 +03:00
parent b78b935f9e
commit a95a02a16a
13 changed files with 664 additions and 3 deletions

View File

@@ -20,6 +20,33 @@ import (
"gopkg.in/kataras/iris.v6/httptest"
)
// No, better to have simple functions, it will be easier for users to understand
// type ParamEvaluator interface {
// Eval() func(string) bool
// Literal() string
// }
// type IntParam struct {
// }
// func (i IntParam) Literal() string {
// return "int"
// }
// func (i IntParam) Eval() func(string) bool {
// r, err := regexp.Compile("[1-9]+$")
// if err != nil {
// panic(err)
// }
// return r.MatchString
// }
// func (i IntParam) Eq(eqToNumber int) func(int) bool {
// return func(param int) bool {
// return eqToNumber == param
// }
// }
// a helper to return a macro from a simple regexp
// it compiles the regexp and after returns the macro, for obviously performance reasons.
func fromRegexp(expr string) _macrofn {