MCPcopy Create free account
hub / github.com/foxcpp/maddy / AddHook

Function AddHook

framework/hooks/hooks.go:75–80  ·  view source on GitHub ↗

AddHook installs the hook to be executed when certain event occurs.

(eventName Event, f func())

Source from the content-addressed store, hash-verified

73
74// AddHook installs the hook to be executed when certain event occurs.
75func AddHook(eventName Event, f func()) {
76 hooksLck.Lock()
77 defer hooksLck.Unlock()
78
79 hooks[eventName] = append(hooks[eventName], f)
80}

Callers 2

RunFunction · 0.92
initFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected