1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-27 14:57:05 +00:00

add RemoveHandler to Party too, as requested at #1658

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-10-12 12:56:54 +03:00
parent f6905a3f79
commit 546c7bf465
4 changed files with 58 additions and 15 deletions

View File

@@ -32,7 +32,7 @@ The codebase for Dependency Injection, Internationalization and localization and
- Add the ability to [share functions](https://github.com/kataras/iris/tree/master/_examples/routing/writing-a-middleware/share-funcs) between handlers chain and add an [example](https://github.com/kataras/iris/tree/master/_examples/routing/writing-a-middleware/share-services) on sharing Go structures (aka services).
- Add the new `Party.UseOnce` method to the `*Route`
- Add a new `*Route.RemoveHandler(interface{}) int`, deletes a handler from begin, main and done handlers based on its name or the handler pc function. Returns the total amount of handlers removed.
- Add a new `*Route.RemoveHandler(...interface{}) int` and `Party.RemoveHandler(...interface{}) Party` methods, delete a handler based on its name or the handler pc function.
```go
func middleware(ctx iris.Context) {