MCPcopy Create free account
hub / github.com/kataras/iris / Version

Function Version

mvc/versioning.go:25–31  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

23//
24// Note that this Option will set the route register rule to `RouteOverlap`.
25func 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

Callers 1

newAppFunction · 0.92

Calls 4

HandlerFunction · 0.92
SetRegisterRuleMethod · 0.65
RouterMethod · 0.65
UseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…