mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 02:17:05 +00:00
new Timeout, TimeoutMessage configuration fields and apps.OnApplicationRegistered listener
This commit is contained in:
12
apps/apps.go
12
apps/apps.go
@@ -48,3 +48,15 @@ func GetAll() []*iris.Application {
|
||||
|
||||
return apps
|
||||
}
|
||||
|
||||
// OnApplicationRegistered adds a function which fires when a new application
|
||||
// is registered.
|
||||
func OnApplicationRegistered(listeners ...func(app *iris.Application)) {
|
||||
appListeners := make([]func(context.Application), 0, len(listeners))
|
||||
for i := range listeners {
|
||||
appListeners = append(appListeners, func(ctxApp context.Application) {
|
||||
listeners[i](ctxApp.(*iris.Application))
|
||||
})
|
||||
}
|
||||
context.OnApplicationRegistered(appListeners...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user