Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: OnFork docs #267

Merged
merged 1 commit into from Aug 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions guide/hooks.md
Expand Up @@ -6,6 +6,7 @@ With Fiber v2.30.0, you can execute custom user functions when to run some metho
- [OnGroup](#ongroup)
- [OnGroupName](#ongroupname)
- [OnListen](#onlisten)
- [OnFork](#onfork)
- [OnShutdown](#onshutdown)

## Constants
Expand All @@ -16,6 +17,7 @@ type OnNameHandler = OnRouteHandler
type OnGroupHandler = func(Group) error
type OnGroupNameHandler = OnGroupHandler
type OnListenHandler = func() error
type OnForkHandler = func(int) error
type OnShutdownHandler = OnListenHandler
```

Expand Down Expand Up @@ -73,6 +75,16 @@ func (app *App) OnListen(handler ...OnListenHandler)
```
{% endcode %}

## OnFork

OnFork is a hook to execute user functions on Fork.

{% code title="Signature" %}
```go
func (app *App) OnFork(handler ...OnForkHandler)
```
{% endcode %}

## OnShutdown

OnShutdown is a hook to execute user functions after Shutdown.
Expand Down