Handler returns a handler which is only fired when the "version" is matched with the requested one. It is not meant to be used by end-developers (exported for version controller feature). Use `NewGroup` instead.
(version string)
| 243 | // (exported for version controller feature). |
| 244 | // Use `NewGroup` instead. |
| 245 | func Handler(version string) context.Handler { |
| 246 | validate, err := semver.ParseRange(version) |
| 247 | if err != nil { |
| 248 | return func(ctx *context.Context) { |
| 249 | ctx.StopWithError(500, err) |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | return makeHandler(validate) |
| 254 | } |
| 255 | |
| 256 | // GetVersionAlias returns the version alias of the given "gotVersion" |
| 257 | // or empty. It Reports whether the alias was found. |
no test coverage detected
searching dependent graphs…