1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-27 13:55:56 +00:00
Former-commit-id: 592e9cddf3511fc08e87f19ad39fdaac479b453f
This commit is contained in:
Frédéric Meyer
2018-02-21 08:18:53 +03:00
parent c0e0886cb9
commit 66209cae4f
6 changed files with 81 additions and 7 deletions

View File

@@ -60,6 +60,13 @@ type Party interface {
// If the current Party is the root, then it registers the middleware to all child Parties' routes too.
Use(middleware ...context.Handler)
// Fallback appends Handler(s) to the current Party's fallback stack.
// Handler(s) is(are) called from Fallback stack when no route found and before sending NotFound status.
// Therefore Handler(s) in Fallback stack could send another thing than NotFound status,
// if `Context.Next()` method is not called.
// Done Handler(s) is(are) not called.
Fallback(middleware ...context.Handler)
// 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.
Done(handlers ...context.Handler)