BaseAPIHandler contains the handlers for API endpoints. It holds a pool of clients to interact with the backend service and manages load balancing, client selection, and configuration.
| 397 | // It holds a pool of clients to interact with the backend service and manages |
| 398 | // load balancing, client selection, and configuration. |
| 399 | type BaseAPIHandler struct { |
| 400 | // AuthManager manages auth lifecycle and execution in the new architecture. |
| 401 | AuthManager *coreauth.Manager |
| 402 | |
| 403 | // Cfg holds the current application configuration. |
| 404 | Cfg *config.SDKConfig |
| 405 | |
| 406 | // PluginHost optionally applies plugin interceptors around upstream execution. |
| 407 | PluginHost PluginInterceptorHost |
| 408 | |
| 409 | // ModelRouterHost optionally routes matching requests to a plugin executor, the router's own |
| 410 | // executor, or a built-in provider before model-to-provider resolution and auth selection. |
| 411 | ModelRouterHost PluginModelRouterHost |
| 412 | |
| 413 | // OnConfigChanged is called when the handler modifies config at runtime |
| 414 | // (e.g. removing a fired injection rule). The server sets this to trigger |
| 415 | // config file persistence. May be nil. |
| 416 | OnConfigChanged func() |
| 417 | } |
| 418 | |
| 419 | // NewBaseAPIHandlers creates a new API handlers instance. |
| 420 | // It takes a slice of clients and configuration as input. |
nothing calls this directly
no outgoing calls
no test coverage detected