* 搜索所有支持的 Registry
(term, page = 1, pageSize = 10)
| 469 | * 搜索所有支持的 Registry |
| 470 | */ |
| 471 | async 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 |
nothing calls this directly
no test coverage detected