WithConfigReloadHook registers a callback used after management saves config changes.
(hook func(context.Context, *config.Config))
| 169 | |
| 170 | // WithConfigReloadHook registers a callback used after management saves config changes. |
| 171 | func WithConfigReloadHook(hook func(context.Context, *config.Config)) ServerOption { |
| 172 | return func(cfg *serverOptionConfig) { |
| 173 | cfg.configReloadHook = hook |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | // Server represents the main API server. |
| 178 | // It encapsulates the Gin engine, HTTP server, handlers, and configuration. |