添加对 PyPI 的支持,包括配置示例、缓存策略和集成测试

This commit is contained in:
2025-11-14 13:11:02 +08:00
parent 39ebf61572
commit 9444531e3b
7 changed files with 340 additions and 28 deletions

View File

@@ -59,6 +59,7 @@ func TestHubTypeValidation(t *testing.T) {
{"docker ok", "docker", false},
{"npm ok", "npm", false},
{"go ok", "go", false},
{"pypi ok", "pypi", false},
{"missing type", "", true},
{"unsupported type", "rubygems", true},
}

View File

@@ -12,9 +12,10 @@ var supportedHubTypes = map[string]struct{}{
"docker": {},
"npm": {},
"go": {},
"pypi": {},
}
const supportedHubTypeList = "docker|npm|go"
const supportedHubTypeList = "docker|npm|go|pypi"
// Validate 针对语义级别做进一步校验,防止非法配置启动服务。
func (c *Config) Validate() error {