🌵hybrid routing with tree and fast router

pull/715/head
ReneWerner87 2020-08-10 10:54:41 +02:00
parent df3c48a734
commit 2c6d7e00c4
2 changed files with 3 additions and 2 deletions

3
app.go
View File

@ -50,7 +50,8 @@ type Error struct {
type App struct {
mutex sync.Mutex
// Route stack divided by HTTP methods
stack [][]*Route
stack [][]*Route
// Route stack divided by HTTP methods and route prefixes
treeStack []map[string][]*Route
// Amount of registered routes
routesCount int

View File

@ -356,7 +356,7 @@ func (app *App) addRoute(method string, route *Route) {
}
}
// uniqueRouteStack
// buildTree build the prefix tree from the previously registered routes
func (app *App) buildTree() *App {
// loop all the methods and stacks and create the prefix tree
for m := range intMethod {