Commit Graph

41 Commits

Author SHA1 Message Date
qm012 9d016f6841 fix #2786 (#2796)
* update match rule

* add comments
2021-08-03 10:40:31 +08:00
qm012 9bc4d8c161 fix #2762 (#2767) 2021-08-03 10:40:21 +08:00
Yue Yang 1a3e58b0a0 Fix conflict between param and exact path (#2706)
* Fix conflict between param and exact path

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* Add test

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* Fix prefix conflict in exact paths

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* Use backtracking

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* Fix panic

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
2021-05-22 07:41:26 +08:00
Ross Wolf f3de8132c5
Add mixed param and non-param paths (port of httprouter#329) (#2663)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2021-04-06 10:49:08 +08:00
thinkerou a573ec6a37
chore: update tree (#2371)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2021-01-03 21:34:11 +08:00
bestgopher 7bffae1d3d
Remove some functions that have the same effect as the bytes package (#2387) 2020-05-23 22:19:37 +08:00
Bo-Yi Wu b4c8bf1bbe
chore(performance): improve countParams (#2378)
* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore: update

* chore: improve countParams performance

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore: add comment
2020-05-17 18:11:22 +08:00
vinhha96 a6e8665e42
fix(tree): reassign fullpath when register new node which the same current node (#2366)
* fix(tree): assign fullpath to current node by fullpath of new node if current node the same new node

* test(router-test): reverse the order when register router when test func GetFullPath

* chg(tree-test): update test case with register new route in TestRouteContextHoldsFullPath

Co-authored-by: vinhha <vinhha@vng.com.vn>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-05-11 13:25:49 +08:00
Bo-Yi Wu d17270dd90
Sync route tree to httprouter latest code (#2368)
* update tree

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update countParams

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix testing

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* udpate

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix testing

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* refactor gin context

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* add fullPath

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore: refactor

* remove unused code

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* remove varsCount

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* refactor

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-05-10 13:22:25 +08:00
thinkerou acac7b1210
tree: range over nodes values (#2229) 2020-02-09 10:46:22 +08:00
Bo-Yi Wu 0e4d8eaf07
tree: remove duplicate assignment (#2222)
copy from cfa3cb764b

Co-authored-by: thinkerou <thinkerou@gmail.com>
2020-01-28 18:35:47 +08:00
Bo-Yi Wu 64e6a7654f docs(path): improve comments (#2223)
* chore(path): improve comments

copy from 15782a78c6

* fix typo

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-01-28 11:38:45 +08:00
thinkerou d6143d8d7c tree: remove one else statement (#2177) 2019-12-18 16:58:38 +08:00
thinkerou 168fa94516
tree: sync httprouter update (#2173) 2019-12-09 15:04:35 +08:00
thinkerou 6e16da8683
tree: sync httprouter update (#2172) 2019-12-08 19:34:05 +08:00
thinkerou c6544855d7 tree: sync httprouter update (#2171) 2019-12-08 18:35:08 +08:00
thinkerou 7c21e04f62
fix maxParams bug (#2166) 2019-12-04 07:56:01 +08:00
thinkerou 3abc96e3cd
tree: sync part httprouter codes and reduce if/else (#2163) 2019-12-01 19:53:03 +08:00
ZYunH b562fed3aa Make countParams more readable (#2052) 2019-09-11 18:10:39 +08:00
bbiao f65018d7b1 Bugfix for the FullPath feature (#1919)
* worked with more complex situations
 * the original pr not work when and a short route with the same prefix
 to some already added routes
2019-06-28 23:54:52 +08:00
Roman Zaynetdinov 35e33d3638 Hold matched route full path in the Context (#1826)
* Return nodeValue from getValue method

* Hold route full path in the Context

* Add small example
2019-05-26 08:20:21 +08:00
Kirill Motkov b1d607a899 Some code improvements (#1909)
* strings.ToLower comparison changed to strings.EqualFold.
* Rewrite switch statement with only one case as if.
2019-05-21 23:08:52 +08:00
田欧 a210eea3bd
improve panic information when a catch-all wildcard conflict occurs (#1529) 2018-09-21 10:21:59 +08:00
Aurelien Regat-Barrel 6e09ef03b0 Fix typo in panic() message (extra single quote) (#1352)
Also fix the same typo in a comment
2018-05-11 09:57:21 +08:00
Boris Borshevsky 6f94fd05c9 Linting and optimizing struct memory signature. (#1184)
* fix cleanPath spell (#969)

* linter and optimize structs
2017-11-29 10:50:14 +08:00
田欧 a8fa424ae5 update comment (#1057) 2017-08-16 11:55:50 +08:00
田欧 b985857899 update func comment (#981) 2017-07-05 20:28:16 -05:00
田欧 7d043cedb1 improved swap (#974) 2017-07-04 20:55:50 -05:00
Javier Provecho Fernandez 80942e67a8 docs(license): add julienschmidt/httprouter license URL 2017-06-27 22:58:49 +02:00
Javier Provecho Fernandez 3b8150c83c Revert "unify license (#942)"
This reverts commit 53799774f4.
2017-06-27 22:54:42 +02:00
田欧 6dac8c8a48 delete else keyword (#948) 2017-06-12 22:36:05 -05:00
田欧 53799774f4 unify license (#942) 2017-06-12 04:01:09 -05:00
Sergey Egorov b1872ec369 The url.RawPath used when engine.UseRawPath is set to true. (#810) 2017-02-28 18:29:41 +08:00
Javier Provecho Fernandez 9e930b9bdd lint code 2016-04-15 01:16:46 +02:00
Manu Mtz.-Almeida 20825e7694 Updates tree.go from httpRouter 2016-01-28 00:14:26 +01:00
Manu Mtz-Almeida 66e9feb622 Optimizes tree lookup 2015-05-29 21:03:28 +02:00
Manu Mtz-Almeida e899d8a99e Code cleanup + documentation 2015-05-28 03:22:34 +02:00
Manu Mtz-Almeida eb3e9293ed Renames []HandleFunc to HandlersChain 2015-05-07 11:30:01 +02:00
Manu Mtz-Almeida f212ae7728 Updates tree.go + fixes + unit tests 2015-05-05 16:37:33 +02:00
Manu Mtz-Almeida 1f6304ca25 Cleaning up performance branch 2015-04-07 12:22:38 +02:00
Manu Mtz-Almeida 2915fa0ffe Zero allocation router, first commit 2015-03-31 21:39:06 +02:00