插件接口

This commit is contained in:
v-me-50
2025-06-16 17:02:47 +08:00
parent 9155f47ec9
commit 143db0baae
5 changed files with 53 additions and 2 deletions

View File

@@ -128,6 +128,11 @@ func AddAccount(email, ca, Kid, HmacEncoded, CADirURL string) error {
return fmt.Errorf("failed to get sqlite: %w", err)
}
now := time.Now().Format("2006-01-02 15:04:05")
if (ca == "sslcom" || ca == "google") && (Kid == "" || HmacEncoded == "") {
return fmt.Errorf("Kid and HmacEncoded are required for %s CA", ca)
} else if ca == "custom" && CADirURL == "" {
return fmt.Errorf("CADirURL is required for custom CA")
}
account := map[string]interface{}{
"email": email,
"type": ca,