MCPcopy
hub / github.com/dqzboy/Docker-Proxy / searchAllRegistries

Function searchAllRegistries

hubcmdui/services/registrySearchService.js:471–496  ·  view source on GitHub ↗

* 搜索所有支持的 Registry

(term, page = 1, pageSize = 10)

Source from the content-addressed store, hash-verified

469 * 搜索所有支持的 Registry
470 */
471async function searchAllRegistries(term, page = 1, pageSize = 10) {
472 const registries = ['docker-hub', 'quay', 'ghcr', 'k8s', 'gcr', 'mcr', 'elastic', 'nvcr'];
473
474 const searchPromises = registries.map(registryId =>
475 searchRegistry(registryId, term, page, pageSize)
476 .catch(error => {
477 logger.warn(`搜索 ${registryId} 失败: ${error.message}`);
478 return {
479 registry: registryId,
480 registryName: REGISTRY_CONFIGS[registryId]?.name || registryId,
481 count: 0,
482 results: [],
483 error: error.message
484 };
485 })
486 );
487
488 const results = await Promise.all(searchPromises);
489
490 return {
491 term,
492 page,
493 pageSize,
494 registries: results
495 };
496}
497
498/**
499 * 获取镜像标签 - 根据 Registry 类型选择不同的 API

Callers

nothing calls this directly

Calls 2

searchRegistryFunction · 0.85
allMethod · 0.80

Tested by

no test coverage detected