mirror of
https://github.com/kataras/iris.git
synced 2025-03-14 08:16:28 +01:00
add godocs for https://github.com/kataras/iris/issues/1589
This commit is contained in:
parent
8340285e7d
commit
c22cb3a188
|
@ -957,6 +957,7 @@ func (api *APIBuilder) UseError(handlers ...context.Handler) {
|
||||||
// If it's called after the routes then these handlers will never be executed.
|
// If it's called after the routes then these handlers will never be executed.
|
||||||
// Use `UseGlobal` if you want to register begin handlers(middleware)
|
// Use `UseGlobal` if you want to register begin handlers(middleware)
|
||||||
// that should be always run before all application's routes.
|
// that should be always run before all application's routes.
|
||||||
|
// To register a middleware for error handlers, look `UseError` method instead.
|
||||||
func (api *APIBuilder) Use(handlers ...context.Handler) {
|
func (api *APIBuilder) Use(handlers ...context.Handler) {
|
||||||
api.middleware = append(api.middleware, handlers...)
|
api.middleware = append(api.middleware, handlers...)
|
||||||
}
|
}
|
||||||
|
@ -964,6 +965,7 @@ func (api *APIBuilder) Use(handlers ...context.Handler) {
|
||||||
// UseOnce either inserts a middleware,
|
// UseOnce either inserts a middleware,
|
||||||
// or on the basis of the middleware already existing,
|
// or on the basis of the middleware already existing,
|
||||||
// replace that existing middleware instead.
|
// replace that existing middleware instead.
|
||||||
|
// To register a middleware for error handlers, look `UseError` method instead.
|
||||||
func (api *APIBuilder) UseOnce(handlers ...context.Handler) {
|
func (api *APIBuilder) UseOnce(handlers ...context.Handler) {
|
||||||
api.middleware = context.UpsertHandlers(api.middleware, handlers)
|
api.middleware = context.UpsertHandlers(api.middleware, handlers)
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,10 +102,12 @@ type Party interface {
|
||||||
UseError(handlers ...context.Handler)
|
UseError(handlers ...context.Handler)
|
||||||
// Use appends Handler(s) to the current Party's routes and child routes.
|
// Use appends Handler(s) to the current Party's routes and child routes.
|
||||||
// If the current Party is the root, then it registers the middleware to all child Parties' routes too.
|
// If the current Party is the root, then it registers the middleware to all child Parties' routes too.
|
||||||
|
// To register a middleware for error handlers, look `UseError` method instead.
|
||||||
Use(middleware ...context.Handler)
|
Use(middleware ...context.Handler)
|
||||||
// UseOnce either inserts a middleware,
|
// UseOnce either inserts a middleware,
|
||||||
// or on the basis of the middleware already existing,
|
// or on the basis of the middleware already existing,
|
||||||
// replace that existing middleware instead.
|
// replace that existing middleware instead.
|
||||||
|
// To register a middleware for error handlers, look `UseError` method instead.
|
||||||
UseOnce(handlers ...context.Handler)
|
UseOnce(handlers ...context.Handler)
|
||||||
// Done appends to the very end, Handler(s) to the current Party's routes and child routes.
|
// Done appends to the very end, Handler(s) to the current Party's routes and child routes.
|
||||||
// The difference from .Use is that this/or these Handler(s) are being always running last.
|
// The difference from .Use is that this/or these Handler(s) are being always running last.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user