add composer

This commit is contained in:
2025-11-17 10:16:27 +08:00
parent 6c6d5273ac
commit 8cff19ecca
10 changed files with 577 additions and 7 deletions

View File

@@ -90,7 +90,12 @@ func applyHubDefaults(h *HubConfig) {
h.CacheTTL = Duration(0)
}
if trimmed := strings.TrimSpace(h.Module); trimmed == "" {
h.Module = hubmodule.DefaultModuleKey()
typeKey := strings.ToLower(strings.TrimSpace(h.Type))
if meta, ok := hubmodule.Resolve(typeKey); ok {
h.Module = meta.Key
} else {
h.Module = hubmodule.DefaultModuleKey()
}
} else {
h.Module = strings.ToLower(trimmed)
}