MCPcopy
hub / github.com/gofiber/fiber / OnMount

Method OnMount

hooks.go:320–324  ·  view source on GitHub ↗

OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter. It works for app and group mounting.

(handler ...OnMountHandler)

Source from the content-addressed store, hash-verified

318// The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter.
319// It works for app and group mounting.
320func (h *Hooks) OnMount(handler ...OnMountHandler) {
321 h.app.mutex.Lock()
322 h.onMount = append(h.onMount, handler...)
323 h.app.mutex.Unlock()
324}
325
326func (h *Hooks) executeOnRouteHooks(route *Route) error {
327 if route == nil {

Callers 2

Test_Hook_OnMountFunction · 0.80

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by 2

Test_Hook_OnMountFunction · 0.64