MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / BuildAPIKeyClients

Function BuildAPIKeyClients

internal/watcher/clients.go:377–405  ·  view source on GitHub ↗
(cfg *config.Config)

Source from the content-addressed store, hash-verified

375}
376
377func 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
407func (w *Watcher) persistConfigAsync() {
408 if w == nil || w.storePersister == nil {

Callers 3

LoadMethod · 0.92
reloadClientsMethod · 0.85

Calls

no outgoing calls

Tested by 1