mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 18:07:01 +00:00
new feature: versioned controllers
Former-commit-id: c797e23c78b1e74bbe9ba56673f3a98f17f5e2f7
This commit is contained in:
26
mvc/mvc.go
26
mvc/mvc.go
@@ -146,13 +146,25 @@ func (app *Application) Register(dependencies ...interface{}) *Application {
|
||||
return app
|
||||
}
|
||||
|
||||
// Option is an interface which does contain a single `Apply` method that accepts
|
||||
// a `ControllerActivator`. It can be passed on `Application.Handle` method to
|
||||
// mdoify the behavior right after the `BeforeActivation` state.
|
||||
//
|
||||
// See `GRPC` package-level structure too.
|
||||
type Option interface {
|
||||
Apply(*ControllerActivator)
|
||||
type (
|
||||
// Option is an interface which does contain a single `Apply` method that accepts
|
||||
// a `ControllerActivator`. It can be passed on `Application.Handle` method to
|
||||
// mdoify the behavior right after the `BeforeActivation` state.
|
||||
//
|
||||
// See `GRPC` package-level structure
|
||||
// and `Version` package-level function too.
|
||||
Option interface {
|
||||
Apply(*ControllerActivator)
|
||||
}
|
||||
|
||||
// OptionFunc is the functional type of `Option`.
|
||||
// Read `Option` docs.
|
||||
OptionFunc func(*ControllerActivator)
|
||||
)
|
||||
|
||||
// Apply completes the `Option` interface.
|
||||
func (opt OptionFunc) Apply(c *ControllerActivator) {
|
||||
opt(c)
|
||||
}
|
||||
|
||||
// Handle serves a controller for the current mvc application's Router.
|
||||
|
||||
Reference in New Issue
Block a user