Version returns a valid `Option` that can be passed to the `Application.Handle` method. It requires a specific "version" constraint for a Controller, e.g. ">1.0.0 <=2.0.0". Usage: m := mvc.New(dataRouter) m.Handle(new(v1Controller), mvc.Version("1.0.0"), mvc.Deprecated(mvc.DeprecationOptions{}))
(version string)
| 23 | // |
| 24 | // Note that this Option will set the route register rule to `RouteOverlap`. |
| 25 | func Version(version string) OptionFunc { |
| 26 | return func(c *ControllerActivator) { |
| 27 | c.Router().SetRegisterRule(router.RouteOverlap) // required for this feature. |
| 28 | // Note: Do not use a group, we need c.Use for the specific controller's routes. |
| 29 | c.Use(versioning.Handler(version)) |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | // Deprecated marks a specific Controller as a deprecated one. |
| 34 | // Deprecated can be used to tell the clients that |
no test coverage detected
searching dependent graphs…