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)
| 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. |
| 277 | func (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. |
| 287 | func (s *Server) AddListener(l listeners.Listener) error { |