(cfg *config.Config)
| 375 | } |
| 376 | |
| 377 | func BuildAPIKeyClients(cfg *config.Config) (int, int, int, int, int) { |
| 378 | geminiAPIKeyCount := 0 |
| 379 | vertexCompatAPIKeyCount := 0 |
| 380 | claudeAPIKeyCount := 0 |
| 381 | codexAPIKeyCount := 0 |
| 382 | openAICompatCount := 0 |
| 383 | |
| 384 | if len(cfg.GeminiKey) > 0 { |
| 385 | geminiAPIKeyCount += len(cfg.GeminiKey) |
| 386 | } |
| 387 | if len(cfg.VertexCompatAPIKey) > 0 { |
| 388 | vertexCompatAPIKeyCount += len(cfg.VertexCompatAPIKey) |
| 389 | } |
| 390 | if len(cfg.ClaudeKey) > 0 { |
| 391 | claudeAPIKeyCount += len(cfg.ClaudeKey) |
| 392 | } |
| 393 | if len(cfg.CodexKey) > 0 { |
| 394 | codexAPIKeyCount += len(cfg.CodexKey) |
| 395 | } |
| 396 | if len(cfg.OpenAICompatibility) > 0 { |
| 397 | for _, compatConfig := range cfg.OpenAICompatibility { |
| 398 | if compatConfig.Disabled { |
| 399 | continue |
| 400 | } |
| 401 | openAICompatCount += len(compatConfig.APIKeyEntries) |
| 402 | } |
| 403 | } |
| 404 | return geminiAPIKeyCount, vertexCompatAPIKeyCount, claudeAPIKeyCount, codexAPIKeyCount, openAICompatCount |
| 405 | } |
| 406 | |
| 407 | func (w *Watcher) persistConfigAsync() { |
| 408 | if w == nil || w.storePersister == nil { |
no outgoing calls