parseRoute analyzes the route and divides it into segments for constant areas and parameters, this information is needed later when assigning the requests to the declared routes
(pattern string, regexHandler any, customConstraints ...CustomConstraint)
| 263 | // parseRoute analyzes the route and divides it into segments for constant areas and parameters, |
| 264 | // this information is needed later when assigning the requests to the declared routes |
| 265 | func parseRoute(pattern string, regexHandler any, customConstraints ...CustomConstraint) routeParser { |
| 266 | parser := routeParser{} |
| 267 | parser.parseRoute(pattern, regexHandler, customConstraints...) |
| 268 | |
| 269 | // Check if the route has too many parameters |
| 270 | if len(parser.params) > maxParams { |
| 271 | panic(fmt.Sprintf("Route '%s' has %d parameters, which exceeds the maximum of %d", |
| 272 | pattern, len(parser.params), maxParams)) |
| 273 | } |
| 274 | |
| 275 | return parser |
| 276 | } |
| 277 | |
| 278 | // addParameterMetaInfo add important meta information to the parameter segments |
| 279 | // to simplify the search for the end of the parameter |