feat: add dogecloud cdn deployer
This commit is contained in:
4
internal/pkg/vendors/qiniu-sdk/client.go
vendored
4
internal/pkg/vendors/qiniu-sdk/client.go
vendored
@@ -12,7 +12,7 @@ import (
|
||||
xhttp "github.com/usual2970/certimate/internal/utils/http"
|
||||
)
|
||||
|
||||
const qiniuHost = "http://api.qiniu.com"
|
||||
const qiniuHost = "https://api.qiniu.com"
|
||||
|
||||
type Client struct {
|
||||
mac *auth.Credentials
|
||||
@@ -129,7 +129,7 @@ func (c *Client) UploadSslCert(name, commonName, pri, ca string) (*UploadSslCert
|
||||
return nil, err
|
||||
}
|
||||
if resp.Code != nil && *resp.Code != 0 && *resp.Code != 200 {
|
||||
return nil, fmt.Errorf("code: %d, error: %s", *resp.Code, *resp.Error)
|
||||
return nil, fmt.Errorf("qiniu api error, code: %d, error: %s", *resp.Code, *resp.Error)
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
|
||||
19
internal/pkg/vendors/qiniu-sdk/models.go
vendored
19
internal/pkg/vendors/qiniu-sdk/models.go
vendored
@@ -1,5 +1,10 @@
|
||||
package qiniusdk
|
||||
|
||||
type BaseResponse struct {
|
||||
Code *int `json:"code,omitempty"`
|
||||
Error *string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
type UploadSslCertRequest struct {
|
||||
Name string `json:"name"`
|
||||
CommonName string `json:"common_name"`
|
||||
@@ -8,9 +13,8 @@ type UploadSslCertRequest struct {
|
||||
}
|
||||
|
||||
type UploadSslCertResponse struct {
|
||||
Code *int `json:"code,omitempty"`
|
||||
Error *string `json:"error,omitempty"`
|
||||
CertID string `json:"certID"`
|
||||
*BaseResponse
|
||||
CertID string `json:"certID"`
|
||||
}
|
||||
|
||||
type DomainInfoHttpsData struct {
|
||||
@@ -20,8 +24,7 @@ type DomainInfoHttpsData struct {
|
||||
}
|
||||
|
||||
type GetDomainInfoResponse struct {
|
||||
Code *int `json:"code,omitempty"`
|
||||
Error *string `json:"error,omitempty"`
|
||||
*BaseResponse
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
CName string `json:"cname"`
|
||||
@@ -39,8 +42,7 @@ type ModifyDomainHttpsConfRequest struct {
|
||||
}
|
||||
|
||||
type ModifyDomainHttpsConfResponse struct {
|
||||
Code *int `json:"code,omitempty"`
|
||||
Error *string `json:"error,omitempty"`
|
||||
*BaseResponse
|
||||
}
|
||||
|
||||
type EnableDomainHttpsRequest struct {
|
||||
@@ -48,6 +50,5 @@ type EnableDomainHttpsRequest struct {
|
||||
}
|
||||
|
||||
type EnableDomainHttpsResponse struct {
|
||||
Code *int `json:"code,omitempty"`
|
||||
Error *string `json:"error,omitempty"`
|
||||
*BaseResponse
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user