diff --git a/guide/hooks.md b/guide/hooks.md index 1f54b1a8d8e..fd65f319f13 100644 --- a/guide/hooks.md +++ b/guide/hooks.md @@ -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 @@ -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 ``` @@ -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.