style: format

This commit is contained in:
Fu Diwei
2024-10-15 21:14:54 +08:00
parent cf3de10eff
commit 26be47d072
29 changed files with 71 additions and 98 deletions

View File

@@ -1,12 +1,13 @@
package applicant
import (
"certimate/internal/domain"
"encoding/json"
"fmt"
"os"
"github.com/go-acme/lego/v4/providers/dns/tencentcloud"
"certimate/internal/domain"
)
type tencent struct {
@@ -20,14 +21,13 @@ func NewTencent(option *ApplyOption) Applicant {
}
func (t *tencent) Apply() (*Certificate, error) {
access := &domain.TencentAccess{}
json.Unmarshal([]byte(t.option.Access), access)
os.Setenv("TENCENTCLOUD_SECRET_ID", access.SecretId)
os.Setenv("TENCENTCLOUD_SECRET_KEY", access.SecretKey)
os.Setenv("TENCENTCLOUD_PROPAGATION_TIMEOUT", fmt.Sprintf("%d", t.option.Timeout))
dnsProvider, err := tencentcloud.NewDNSProvider()
if err != nil {
return nil, err