MCPcopy
hub / github.com/mochi-mqtt/server / AddHooksFromConfig

Method AddHooksFromConfig

server.go:277–284  ·  view source on GitHub ↗

AddHooksFromConfig adds hooks to the server which were specified in the hooks config (usually from a config file). New built-in hooks should be added to this list.

(hooks []HookLoadConfig)

Source from the content-addressed store, hash-verified

275// AddHooksFromConfig adds hooks to the server which were specified in the hooks config (usually from a config file).
276// New built-in hooks should be added to this list.
277func (s *Server) AddHooksFromConfig(hooks []HookLoadConfig) error {
278 for _, h := range hooks {
279 if err := s.AddHook(h.Hook, h.Config); err != nil {
280 return err
281 }
282 }
283 return nil
284}
285
286// AddListener adds a new network listener to the server, for receiving incoming client connections.
287func (s *Server) AddListener(l listeners.Listener) error {

Callers 3

ServeMethod · 0.95

Calls 1

AddHookMethod · 0.95

Tested by 2