Skip to content

Commit

Permalink
Update hooks.md
Browse files Browse the repository at this point in the history
fix wrong hooks signature
  • Loading branch information
ReneWerner87 committed Dec 19, 2023
1 parent dc2d2ef commit 43fa236
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/guide/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type OnMountHandler = func(*App) error
OnRoute is a hook to execute user functions on each route registeration. Also you can get route properties by **route** parameter.

```go title="Signature"
func (app *App) OnRoute(handler ...OnRouteHandler)
func (h *Hooks) OnRoute(handler ...OnRouteHandler)
```

## OnName
Expand All @@ -47,7 +47,7 @@ OnName only works with naming routes, not groups.
:::

```go title="Signature"
func (app *App) OnName(handler ...OnNameHandler)
func (h *Hooks) OnName(handler ...OnNameHandler)
```

<Tabs>
Expand Down Expand Up @@ -104,7 +104,7 @@ func main() {
OnGroup is a hook to execute user functions on each group registeration. Also you can get group properties by **group** parameter.

```go title="Signature"
func (app *App) OnGroup(handler ...OnGroupHandler)
func (h *Hooks) OnGroup(handler ...OnGroupHandler)
```

## OnGroupName
Expand All @@ -116,15 +116,15 @@ OnGroupName only works with naming groups, not routes.
:::

```go title="Signature"
func (app *App) OnGroupName(handler ...OnGroupNameHandler)
func (h *Hooks) OnGroupName(handler ...OnGroupNameHandler)
```

## OnListen

OnListen is a hook to execute user functions on Listen, ListenTLS, Listener.

```go title="Signature"
func (app *App) OnListen(handler ...OnListenHandler)
func (h *Hooks) OnListen(handler ...OnListenHandler)
```

<Tabs>
Expand Down Expand Up @@ -158,15 +158,15 @@ app.Listen(":5000")
OnFork is a hook to execute user functions on Fork.

```go title="Signature"
func (app *App) OnFork(handler ...OnForkHandler)
func (h *Hooks) OnFork(handler ...OnForkHandler)
```

## OnShutdown

OnShutdown is a hook to execute user functions after Shutdown.

```go title="Signature"
func (app *App) OnShutdown(handler ...OnShutdownHandler)
func (h *Hooks) OnShutdown(handler ...OnShutdownHandler)
```

## OnMount
Expand Down

0 comments on commit 43fa236

Please sign in to comment.