feat(cert): add registry-based DNS provider system with 21 libdns providers

Refs #37
This commit is contained in:
xboard
2026-04-20 03:01:21 +08:00
parent 07c37023ab
commit 68ca2d2716
31 changed files with 1575 additions and 48 deletions
+22
View File
@@ -0,0 +1,22 @@
package dnsproviders
import (
"fmt"
"strings"
)
// firstOf returns the value of the first non-empty env key from candidates.
// Lookup is case-sensitive (env keys are conventionally upper-case).
func firstOf(env map[string]string, keys ...string) string {
for _, k := range keys {
if v := strings.TrimSpace(env[k]); v != "" {
return v
}
}
return ""
}
// missingEnvErr formats a "missing required env" error consistently.
func missingEnvErr(provider string, keys ...string) error {
return fmt.Errorf("dns provider %q requires one of %s in dns_env", provider, strings.Join(keys, ", "))
}