chore: move '/internal/pkg' to '/pkg'

This commit is contained in:
Fu Diwei
2025-06-17 15:54:21 +08:00
parent 30840bbba5
commit 205275b52d
611 changed files with 693 additions and 693 deletions

View File

@@ -0,0 +1,55 @@
package console
import (
"context"
"fmt"
"net/http"
)
type HttpsCertificateManagerDomain struct {
Name string `json:"name"`
Type string `json:"type"`
BucketId int64 `json:"bucket_id"`
BucketName string `json:"bucket_name"`
}
type GetHttpsCertificateManagerResponse struct {
apiResponseBase
Data *struct {
apiResponseBaseData
AuthenticateNum int32 `json:"authenticate_num"`
AuthenticateDomains []string `json:"authenticate_domain"`
Domains []HttpsCertificateManagerDomain `json:"domains"`
} `json:"data,omitempty"`
}
func (c *Client) GetHttpsCertificateManager(certificateId string) (*GetHttpsCertificateManagerResponse, error) {
return c.GetHttpsCertificateManagerWithContext(context.Background(), certificateId)
}
func (c *Client) GetHttpsCertificateManagerWithContext(ctx context.Context, certificateId string) (*GetHttpsCertificateManagerResponse, error) {
if certificateId == "" {
return nil, fmt.Errorf("sdkerr: unset certificateId")
}
if err := c.ensureCookieExists(); err != nil {
return nil, err
}
httpreq, err := c.newRequest(http.MethodGet, "/api/https/certificate/manager/")
if err != nil {
return nil, err
} else {
httpreq.SetQueryParam("certificate_id", certificateId)
httpreq.SetContext(ctx)
}
result := &GetHttpsCertificateManagerResponse{}
if _, err := c.doRequestWithResult(httpreq, result); err != nil {
return result, err
}
return result, nil
}