refactor: clean code

This commit is contained in:
Fu Diwei 2026-06-10 23:13:22 +08:00
parent 03a7c0bd2f
commit 1bdcaada8d
90 changed files with 766 additions and 747 deletions

View File

@ -175,7 +175,7 @@ func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
return d.config.PropagationTimeout, d.config.PollingInterval
}
func (d *DNSProvider) findZone(ctx context.Context, zoneName string) (*conohavpssdk.DnsDomainRecord, error) {
func (d *DNSProvider) findZone(ctx context.Context, zoneName string) (*conohavpssdk.Domain, error) {
offset := 0
limit := 10
for {

View File

@ -94,7 +94,7 @@ func (c *Certmgr) Upload(ctx context.Context, certPEM, privkeyPEM string) (*Uplo
// 如果以上信息都一致,则视为已存在相同证书,直接返回
c.logger.Info("ssl certificate already exists")
return &UploadResult{
CertId: certItem.CertificateId,
CertId: certItem.Id,
CertName: certItem.Name,
}, nil
}

View File

@ -93,7 +93,7 @@ func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*Dep
return &DeployResult{}, nil
}
func (d *Deployer) findSiteByName(ctx context.Context, siteName string) (*btwafsdk.SiteRecord, error) {
func (d *Deployer) findSiteByName(ctx context.Context, siteName string) (*btwafsdk.SiteData, error) {
// 查询网站列表
getSiteListPage := 1
getSiteListPageSize := 100

View File

@ -73,7 +73,7 @@ func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*Dep
// 获取自定义域名配置
// REF: https://eop.ctyun.cn/ebp/ctapiDocument/search?sid=53&api=16002&data=42&isNormal=1&vid=40
var faasCustomDomain *ctyunfaas.CustomDomainRecord
var faasCustomDomain *ctyunfaas.CustomDomain
getCustomDomainReq := &ctyunfaas.GetCustomDomainRequest{
RegionId: lo.ToPtr(d.config.RegionId),
DomainName: lo.ToPtr(d.config.Domain),

View File

@ -158,13 +158,13 @@ func (d *Deployer) deployToHost(ctx context.Context, certPEM, privkeyPEM string)
}
hostIds = lo.Map(
lo.Filter(hostCandidates, func(hostItem *npmsdk.HostRecord, _ int) bool {
lo.Filter(hostCandidates, func(hostItem *npmsdk.Host, _ int) bool {
return len(hostItem.DomainNames) > 0 &&
lo.EveryBy(hostItem.DomainNames, func(domain string) bool {
return certX509.VerifyHostname(domain) == nil
})
}),
func(hostItem *npmsdk.HostRecord, _ int) int64 {
func(hostItem *npmsdk.Host, _ int) int64 {
return hostItem.Id
},
)
@ -174,7 +174,7 @@ func (d *Deployer) deployToHost(ctx context.Context, certPEM, privkeyPEM string)
// 跳过已部署过的主机
hostIds = lo.Filter(hostIds, func(hostId int64, _ int) bool {
hostInfo, _ := lo.Find(hostCandidates, func(hostItem *npmsdk.HostRecord) bool {
hostInfo, _ := lo.Find(hostCandidates, func(hostItem *npmsdk.Host) bool {
return hostId == hostItem.Id
})
if hostInfo != nil {
@ -252,8 +252,8 @@ func (d *Deployer) deployToCertificate(ctx context.Context, certPEM, privkeyPEM
return nil
}
func (d *Deployer) getAllHosts(ctx context.Context, cloudHostType string) ([]*npmsdk.HostRecord, error) {
var hosts []*npmsdk.HostRecord
func (d *Deployer) getAllHosts(ctx context.Context, cloudHostType string) ([]*npmsdk.Host, error) {
var hosts []*npmsdk.Host
switch cloudHostType {
case HOST_TYPE_PROXY:
{
@ -264,9 +264,9 @@ func (d *Deployer) getAllHosts(ctx context.Context, cloudHostType string) ([]*np
return nil, fmt.Errorf("failed to execute sdk request 'nginx.ListProxyHosts': %w", err)
}
hosts = make([]*npmsdk.HostRecord, 0, len(*nginxListProxyHostsResp))
hosts = make([]*npmsdk.Host, 0, len(*nginxListProxyHostsResp))
for _, hostItem := range *nginxListProxyHostsResp {
hosts = append(hosts, &hostItem.HostRecord)
hosts = append(hosts, &hostItem.Host)
}
}
@ -279,9 +279,9 @@ func (d *Deployer) getAllHosts(ctx context.Context, cloudHostType string) ([]*np
return nil, fmt.Errorf("failed to execute sdk request 'nginx.ListRedirectionHosts': %w", err)
}
hosts = make([]*npmsdk.HostRecord, 0, len(*nginxListRedirectionHostsResp))
hosts = make([]*npmsdk.Host, 0, len(*nginxListRedirectionHostsResp))
for _, hostItem := range *nginxListRedirectionHostsResp {
hosts = append(hosts, &hostItem.HostRecord)
hosts = append(hosts, &hostItem.Host)
}
}
@ -294,9 +294,9 @@ func (d *Deployer) getAllHosts(ctx context.Context, cloudHostType string) ([]*np
return nil, fmt.Errorf("failed to execute sdk request 'nginx.ListStreams': %w", err)
}
hosts = make([]*npmsdk.HostRecord, 0, len(*nginxListStreamsResp))
hosts = make([]*npmsdk.Host, 0, len(*nginxListStreamsResp))
for _, hostItem := range *nginxListStreamsResp {
hosts = append(hosts, &hostItem.HostRecord)
hosts = append(hosts, &hostItem.Host)
}
}
@ -309,9 +309,9 @@ func (d *Deployer) getAllHosts(ctx context.Context, cloudHostType string) ([]*np
return nil, fmt.Errorf("failed to execute sdk request 'nginx.ListDeadHosts': %w", err)
}
hosts = make([]*npmsdk.HostRecord, 0, len(*nginxListDeadHostsResp))
hosts = make([]*npmsdk.Host, 0, len(*nginxListDeadHostsResp))
for _, hostItem := range *nginxListDeadHostsResp {
hosts = append(hosts, &hostItem.HostRecord)
hosts = append(hosts, &hostItem.Host)
}
}

View File

@ -99,7 +99,7 @@ func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*Dep
if err != nil {
return nil, fmt.Errorf("failed to encrypt private key: %w", err)
}
certificateNewVersionInfo := &wangsucdnpro.CertificateVersionInfo{
certificateNewVersionInfo := &wangsucdnpro.CertificateVersion{
PrivateKey: lo.ToPtr(encryptedPrivateKey),
Certificate: lo.ToPtr(certPEM),
}
@ -172,7 +172,7 @@ func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*Dep
createDeploymentTaskReq := &wangsucdnpro.CreateDeploymentTaskRequest{
Name: lo.ToPtr(fmt.Sprintf("certimate_%d", time.Now().UnixMilli())),
Target: lo.ToPtr(d.config.Environment),
Actions: &[]wangsucdnpro.DeploymentTaskActionInfo{
Actions: &[]wangsucdnpro.DeploymentTaskAction{
{
Action: lo.ToPtr("deploy_cert"),
CertificateId: lo.ToPtr(wangsuCertId),

View File

@ -18,10 +18,10 @@ type GetDomainListResponse struct {
sdkResponseBase
Data []*struct {
List []*DomainRecord `json:"list"`
PageNumber json.Number `json:"page_number"`
PageSize json.Number `json:"page_size"`
TotalNumber json.Number `json:"total_number"`
List []*Domain `json:"list"`
PageNumber json.Number `json:"page_number"`
PageSize json.Number `json:"page_size"`
TotalNumber json.Number `json:"total_number"`
} `json:"data,omitempty"`
}

View File

@ -0,0 +1,34 @@
package baishan
import (
"encoding/json"
)
type Domain struct {
Id string `json:"id"`
Domain string `json:"domain"`
Type string `json:"type"`
Status string `json:"status"`
Cname string `json:"cname"`
Area string `json:"area"`
CreateTime string `json:"create_time"`
UpdateTime string `json:"update_time"`
}
type DomainCertificate struct {
CertId json.Number `json:"cert_id"`
Name string `json:"name"`
CertStartTime string `json:"cert_start_time"`
CertExpireTime string `json:"cert_expire_time"`
}
type DomainConfig struct {
Https *DomainConfigHttps `json:"https"`
}
type DomainConfigHttps struct {
CertId json.Number `json:"cert_id"`
ForceHttps *string `json:"force_https,omitempty"`
EnableHttp2 *string `json:"http2,omitempty"`
EnableOcsp *string `json:"ocsp,omitempty"`
}

View File

@ -1,9 +1,5 @@
package baishan
import (
"encoding/json"
)
type sdkResponse interface {
GetCode() int
GetMessage() string
@ -31,32 +27,3 @@ func (r *sdkResponseBase) GetMessage() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type DomainRecord struct {
Id string `json:"id"`
Domain string `json:"domain"`
Type string `json:"type"`
Status string `json:"status"`
Cname string `json:"cname"`
Area string `json:"area"`
CreateTime string `json:"create_time"`
UpdateTime string `json:"update_time"`
}
type DomainCertificate struct {
CertId json.Number `json:"cert_id"`
Name string `json:"name"`
CertStartTime string `json:"cert_start_time"`
CertExpireTime string `json:"cert_expire_time"`
}
type DomainConfig struct {
Https *DomainConfigHttps `json:"https"`
}
type DomainConfigHttps struct {
CertId json.Number `json:"cert_id"`
ForceHttps *string `json:"force_https,omitempty"`
EnableHttp2 *string `json:"http2,omitempty"`
EnableOcsp *string `json:"ocsp,omitempty"`
}

View File

@ -0,0 +1,23 @@
package btpanelgo
type SiteData struct {
Id int32 `json:"id"`
ProjectType string `json:"project_type"`
Name string `json:"name"`
Note string `json:"ps"`
Status string `json:"status"`
SSLInfo []*struct {
Name string `json:"name"`
Status bool `json:"status"`
} `json:"ssl_info"`
AddTime string `json:"addtime"`
}
type PageData struct {
Page int32 `json:"page"`
Limit int32 `json:"limit"`
Total int32 `json:"total"`
Start int32 `json:"start"`
End int32 `json:"end"`
MaxPage int32 `json:"maxPage"`
}

View File

@ -22,25 +22,3 @@ func (r *sdkResponseBase) GetStatus() json.RawMessage {
func (r *sdkResponseBase) GetMessage() *string {
return r.Message
}
type SiteData struct {
Id int32 `json:"id"`
ProjectType string `json:"project_type"`
Name string `json:"name"`
Note string `json:"ps"`
Status string `json:"status"`
SSLInfo []*struct {
Name string `json:"name"`
Status bool `json:"status"`
} `json:"ssl_info"`
AddTime string `json:"addtime"`
}
type PageData struct {
Page int32 `json:"page"`
Limit int32 `json:"limit"`
Total int32 `json:"total"`
Start int32 `json:"start"`
End int32 `json:"end"`
MaxPage int32 `json:"maxPage"`
}

View File

@ -15,8 +15,8 @@ type GetSiteListResponse struct {
sdkResponseBase
Result *struct {
List []*SiteRecord `json:"list"`
Total int32 `json:"total"`
List []*SiteData `json:"list"`
Total int32 `json:"total"`
} `json:"res,omitempty"`
}

View File

@ -0,0 +1,27 @@
package btwaf
type SiteData struct {
SiteId string `json:"site_id"`
SiteName string `json:"site_name"`
Type string `json:"types"`
Status int32 `json:"status"`
ServerNames []string `json:"server_name"`
CreateTime int64 `json:"create_time"`
UpdateTime int64 `json:"update_time"`
}
// type SiteServerInfo struct {
// ListenSSLPorts *[]int32 `json:"listen_ssl_port,omitempty"`
// SSL *SiteServerSSLInfo `json:"ssl,omitempty"`
// }
type SiteServerInfoMod struct {
ListenSSLPorts []*string `json:"listen_ssl_port,omitempty"`
SSL *SiteServerSSLInfo `json:"ssl,omitempty"`
}
type SiteServerSSLInfo struct {
IsSSL *int32 `json:"is_ssl,omitempty"`
FullChain *string `json:"full_chain,omitempty"`
PrivateKey *string `json:"private_key,omitempty"`
}

View File

@ -17,29 +17,3 @@ func (r *sdkResponseBase) GetCode() int {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type SiteRecord struct {
SiteId string `json:"site_id"`
SiteName string `json:"site_name"`
Type string `json:"types"`
Status int32 `json:"status"`
ServerNames []string `json:"server_name"`
CreateTime int64 `json:"create_time"`
UpdateTime int64 `json:"update_time"`
}
// type SiteServerInfo struct {
// ListenSSLPorts *[]int32 `json:"listen_ssl_port,omitempty"`
// SSL *SiteServerSSLInfo `json:"ssl,omitempty"`
// }
type SiteServerInfoMod struct {
ListenSSLPorts []*string `json:"listen_ssl_port,omitempty"`
SSL *SiteServerSSLInfo `json:"ssl,omitempty"`
}
type SiteServerSSLInfo struct {
IsSSL *int32 `json:"is_ssl,omitempty"`
FullChain *string `json:"full_chain,omitempty"`
PrivateKey *string `json:"private_key,omitempty"`
}

View File

@ -0,0 +1,22 @@
package cloudflare
type GeoRestriction struct {
Label string `json:"label"`
}
type CustomCertificate struct {
ID string `json:"id"`
ZoneID string `json:"zone_id"`
BundleMethod string `json:"bundle_method"`
CustomCsrID string `json:"custom_csr_id"`
GeoRestrictions []GeoRestriction `json:"geo_restrictions"`
Hosts []string `json:"hosts"`
Issuer string `json:"issuer"`
PolicyRestrictions string `json:"policy_restrictions"`
Priority float64 `json:"priority"`
Signature string `json:"signature"`
Status string `json:"status"`
ExpiresOn string `json:"expires_on"`
UploadedOn string `json:"uploaded_on"`
ModifiedOn string `json:"modified_on"`
}

View File

@ -11,31 +11,31 @@ type sdkResponse interface {
}
type sdkResponseBase struct {
Errors APIErrors `json:"errors,omitempty"`
Messages []APIMessage `json:"messages,omitempty"`
Success bool `json:"success,omitempty"`
Errors sdkAPIErrors `json:"errors,omitempty"`
Messages []sdkAPIMessage `json:"messages,omitempty"`
Success bool `json:"success,omitempty"`
}
type APIMessage struct {
Code int `json:"code"`
Message string `json:"message"`
DocumentationURL string `json:"documentation_url"`
ErrorChain []APIErrorChain `json:"error_chain"`
Source *APISource `json:"source"`
type sdkAPIMessage struct {
Code int `json:"code"`
Message string `json:"message"`
DocumentationURL string `json:"documentation_url"`
ErrorChain []sdkAPIErrorChain `json:"error_chain"`
Source *sdkAPISource `json:"source"`
}
type APIErrors []APIMessage
type sdkAPIErrors []sdkAPIMessage
type APIErrorChain struct {
type sdkAPIErrorChain struct {
Code int `json:"code"`
Message string `json:"message"`
}
type APISource struct {
type sdkAPISource struct {
Pointer string `json:"pointer"`
}
func (e APIErrors) Error() string {
func (e sdkAPIErrors) Error() string {
builder := &strings.Builder{}
for _, item := range e {
@ -61,24 +61,3 @@ func (r *sdkResponseBase) GetSuccess() bool {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type GeoRestriction struct {
Label string `json:"label"`
}
type CustomCertificate struct {
ID string `json:"id"`
ZoneID string `json:"zone_id"`
BundleMethod string `json:"bundle_method"`
CustomCsrID string `json:"custom_csr_id"`
GeoRestrictions []GeoRestriction `json:"geo_restrictions"`
Hosts []string `json:"hosts"`
Issuer string `json:"issuer"`
PolicyRestrictions string `json:"policy_restrictions"`
Priority float64 `json:"priority"`
Signature string `json:"signature"`
Status string `json:"status"`
ExpiresOn string `json:"expires_on"`
UploadedOn string `json:"uploaded_on"`
ModifiedOn string `json:"modified_on"`
}

View File

@ -18,8 +18,8 @@ type DnsGetDomainsListRequest struct {
type DnsGetDomainsListResponse struct {
sdkResponseBase
Domains []*DnsDomainRecord `json:"domains,omitempty"`
TotalCount int `json:"total_count,omitempty"`
Domains []*Domain `json:"domains,omitempty"`
TotalCount int `json:"total_count,omitempty"`
}
func (c *Client) DnsGetDomainsList(req *DnsGetDomainsListRequest) (*DnsGetDomainsListResponse, error) {

View File

@ -0,0 +1,8 @@
package v3
type Domain struct {
UUID string `json:"uuid"`
Name string `json:"name"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}

View File

@ -27,10 +27,3 @@ func (r *sdkResponseBase) GetError() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type DnsDomainRecord struct {
UUID string `json:"uuid"`
Name string `json:"name"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}

View File

@ -17,11 +17,11 @@ type ListCertsResponse struct {
sdkResponseBase
ReturnObj *struct {
Results []*CertRecord `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PerPage int32 `json:"per_page,omitempty"`
TotalPage int32 `json:"total_page,omitempty"`
TotalRecords int32 `json:"total_records,omitempty"`
Results []*Cert `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PerPage int32 `json:"per_page,omitempty"`
TotalPage int32 `json:"total_page,omitempty"`
TotalRecords int32 `json:"total_records,omitempty"`
} `json:"returnObj,omitempty"`
}

View File

@ -20,11 +20,11 @@ type QueryDomainsResponse struct {
sdkResponseBase
ReturnObj *struct {
Results []*DomainRecord `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PageSize int32 `json:"page_size,omitempty"`
PageCount int32 `json:"page_count,omitempty"`
Total int32 `json:"total,omitempty"`
Results []*Domain `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PageSize int32 `json:"page_size,omitempty"`
PageCount int32 `json:"page_count,omitempty"`
Total int32 `json:"total,omitempty"`
} `json:"returnObj,omitempty"`
}

View File

@ -0,0 +1,46 @@
package ao
type Domain struct {
Domain string `json:"domain"`
Cname string `json:"cname"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
Status int32 `json:"status"`
AreaScope int32 `json:"area_scope"`
}
type DomainOriginConfig struct {
Origin string `json:"origin"`
Role string `json:"role"`
Weight string `json:"weight"`
}
type DomainOriginConfigWithWeight struct {
Origin string `json:"origin"`
Role string `json:"role"`
Weight int32 `json:"weight"`
}
type DomainHttpsBasicConfig struct {
HttpsForce string `json:"https_force,omitempty"`
ForceStatus string `json:"force_status,omitempty"`
}
type Cert struct {
Id int64 `json:"id"`
Name string `json:"name"`
CN string `json:"cn"`
SANs []string `json:"sans"`
UsageMode int32 `json:"usage_mode"`
State int32 `json:"state"`
ExpiresTime int64 `json:"expires"`
IssueTime int64 `json:"issue"`
Issuer string `json:"issuer"`
CreatedTime int64 `json:"created"`
}
type CertDetail struct {
Cert
Certs string `json:"certs"`
Key string `json:"key"`
}

View File

@ -69,48 +69,3 @@ func (r *sdkResponseBase) GetErrorMessage() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type CertRecord struct {
Id int64 `json:"id"`
Name string `json:"name"`
CN string `json:"cn"`
SANs []string `json:"sans"`
UsageMode int32 `json:"usage_mode"`
State int32 `json:"state"`
ExpiresTime int64 `json:"expires"`
IssueTime int64 `json:"issue"`
Issuer string `json:"issuer"`
CreatedTime int64 `json:"created"`
}
type CertDetail struct {
CertRecord
Certs string `json:"certs"`
Key string `json:"key"`
}
type DomainRecord struct {
Domain string `json:"domain"`
Cname string `json:"cname"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
Status int32 `json:"status"`
AreaScope int32 `json:"area_scope"`
}
type DomainOriginConfig struct {
Origin string `json:"origin"`
Role string `json:"role"`
Weight string `json:"weight"`
}
type DomainOriginConfigWithWeight struct {
Origin string `json:"origin"`
Role string `json:"role"`
Weight int32 `json:"weight"`
}
type DomainHttpsBasicConfig struct {
HttpsForce string `json:"https_force,omitempty"`
ForceStatus string `json:"force_status,omitempty"`
}

View File

@ -17,11 +17,11 @@ type QueryCertListResponse struct {
sdkResponseBase
ReturnObj *struct {
Results []*CertRecord `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PerPage int32 `json:"per_page,omitempty"`
TotalPage int32 `json:"total_page,omitempty"`
TotalRecords int32 `json:"total_records,omitempty"`
Results []*Cert `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PerPage int32 `json:"per_page,omitempty"`
TotalPage int32 `json:"total_page,omitempty"`
TotalRecords int32 `json:"total_records,omitempty"`
} `json:"returnObj,omitempty"`
}

View File

@ -20,11 +20,11 @@ type QueryDomainListResponse struct {
sdkResponseBase
ReturnObj *struct {
Results []*DomainRecord `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PageSize int32 `json:"page_size,omitempty"`
PageCount int32 `json:"page_count,omitempty"`
Total int32 `json:"total,omitempty"`
Results []*Domain `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PageSize int32 `json:"page_size,omitempty"`
PageCount int32 `json:"page_count,omitempty"`
Total int32 `json:"total,omitempty"`
} `json:"returnObj,omitempty"`
}

View File

@ -0,0 +1,45 @@
package cdn
type Domain struct {
Domain string `json:"domain"`
Cname string `json:"cname"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
AreaScope int32 `json:"area_scope"`
Status int32 `json:"status"`
}
type DomainDetail struct {
Domain
HttpsStatus string `json:"https_status"`
HttpsBasic *DomainHttpsBasicConfig `json:"https_basic,omitempty"`
CertName string `json:"cert_name"`
Ssl string `json:"ssl"`
SslStapling string `json:"ssl_stapling"`
}
type DomainHttpsBasicConfig struct {
HttpsForce string `json:"https_force"`
HttpForce string `json:"http_force"`
ForceStatus string `json:"force_status"`
OriginProtocol string `json:"origin_protocol"`
}
type Cert struct {
Id int64 `json:"id"`
Name string `json:"name"`
CN string `json:"cn"`
SANs []string `json:"sans"`
UsageMode int32 `json:"usage_mode"`
State int32 `json:"state"`
ExpiresTime int64 `json:"expires"`
IssueTime int64 `json:"issue"`
Issuer string `json:"issuer"`
CreatedTime int64 `json:"created"`
}
type CertDetail struct {
Cert
Certs string `json:"certs"`
Key string `json:"key"`
}

View File

@ -69,47 +69,3 @@ func (r *sdkResponseBase) GetErrorMessage() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type DomainRecord struct {
Domain string `json:"domain"`
Cname string `json:"cname"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
AreaScope int32 `json:"area_scope"`
Status int32 `json:"status"`
}
type DomainDetail struct {
DomainRecord
HttpsStatus string `json:"https_status"`
HttpsBasic *DomainHttpsBasicConfig `json:"https_basic,omitempty"`
CertName string `json:"cert_name"`
Ssl string `json:"ssl"`
SslStapling string `json:"ssl_stapling"`
}
type DomainHttpsBasicConfig struct {
HttpsForce string `json:"https_force"`
HttpForce string `json:"http_force"`
ForceStatus string `json:"force_status"`
OriginProtocol string `json:"origin_protocol"`
}
type CertRecord struct {
Id int64 `json:"id"`
Name string `json:"name"`
CN string `json:"cn"`
SANs []string `json:"sans"`
UsageMode int32 `json:"usage_mode"`
State int32 `json:"state"`
ExpiresTime int64 `json:"expires"`
IssueTime int64 `json:"issue"`
Issuer string `json:"issuer"`
CreatedTime int64 `json:"created"`
}
type CertDetail struct {
CertRecord
Certs string `json:"certs"`
Key string `json:"key"`
}

View File

@ -17,8 +17,8 @@ type GetCertificateListResponse struct {
sdkResponseBase
ReturnObj *struct {
List []*CertificateRecord `json:"list,omitempty"`
TotalSize int32 `json:"totalSize,omitempty"`
List []*Certificate `json:"list,omitempty"`
TotalSize int32 `json:"totalSize,omitempty"`
} `json:"returnObj,omitempty"`
}

View File

@ -0,0 +1,24 @@
package cms
type Certificate struct {
Id string `json:"id"`
Origin string `json:"origin"`
Type string `json:"type"`
ResourceId string `json:"resourceId"`
ResourceType string `json:"resourceType"`
CertificateId string `json:"certificateId"`
CertificateMode string `json:"certificateMode"`
Name string `json:"name"`
Status string `json:"status"`
DetailStatus string `json:"detailStatus"`
ManagedStatus string `json:"managedStatus"`
Fingerprint string `json:"fingerprint"`
IssueTime string `json:"issueTime"`
ExpireTime string `json:"expireTime"`
DomainType string `json:"domainType"`
DomainName string `json:"domainName"`
EncryptionStandard string `json:"encryptionStandard"`
EncryptionAlgorithm string `json:"encryptionAlgorithm"`
CreateTime string `json:"createTime"`
UpdateTime string `json:"updateTime"`
}

View File

@ -69,26 +69,3 @@ func (r *sdkResponseBase) GetErrorMessage() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type CertificateRecord struct {
Id string `json:"id"`
Origin string `json:"origin"`
Type string `json:"type"`
ResourceId string `json:"resourceId"`
ResourceType string `json:"resourceType"`
CertificateId string `json:"certificateId"`
CertificateMode string `json:"certificateMode"`
Name string `json:"name"`
Status string `json:"status"`
DetailStatus string `json:"detailStatus"`
ManagedStatus string `json:"managedStatus"`
Fingerprint string `json:"fingerprint"`
IssueTime string `json:"issueTime"`
ExpireTime string `json:"expireTime"`
DomainType string `json:"domainType"`
DomainName string `json:"domainName"`
EncryptionStandard string `json:"encryptionStandard"`
EncryptionAlgorithm string `json:"encryptionAlgorithm"`
CreateTime string `json:"createTime"`
UpdateTime string `json:"updateTime"`
}

View File

@ -20,7 +20,7 @@ type QueryRecordListResponse struct {
sdkResponseBase
ReturnObj *struct {
Records []*DnsRecord `json:"records,omitempty"`
Records []*DNSRecord `json:"records,omitempty"`
} `json:"returnObj,omitempty"`
}

View File

@ -0,0 +1,12 @@
package dns
type DNSRecord struct {
RecordId int32 `json:"recordId"`
Host string `json:"host"`
Type string `json:"type"`
LineCode string `json:"lineCode"`
Value string `json:"value"`
TTL int32 `json:"ttl"`
State int32 `json:"state"`
Remark string `json:"remark"`
}

View File

@ -69,14 +69,3 @@ func (r *sdkResponseBase) GetErrorMessage() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type DnsRecord struct {
RecordId int32 `json:"recordId"`
Host string `json:"host"`
Type string `json:"type"`
LineCode string `json:"lineCode"`
Value string `json:"value"`
TTL int32 `json:"ttl"`
State int32 `json:"state"`
Remark string `json:"remark"`
}

View File

@ -18,7 +18,7 @@ type ListCertificatesRequest struct {
type ListCertificatesResponse struct {
sdkResponseBase
ReturnObj []*CertificateRecord `json:"returnObj,omitempty"`
ReturnObj []*Certificate `json:"returnObj,omitempty"`
}
func (c *Client) ListCertificates(req *ListCertificatesRequest) (*ListCertificatesResponse, error) {

View File

@ -20,7 +20,7 @@ type ListListenersRequest struct {
type ListListenersResponse struct {
sdkResponseBase
ReturnObj []*ListenerRecord `json:"returnObj,omitempty"`
ReturnObj []*Listener `json:"returnObj,omitempty"`
}
func (c *Client) ListListeners(req *ListListenersRequest) (*ListListenersResponse, error) {

View File

@ -16,7 +16,7 @@ type ShowListenerRequest struct {
type ShowListenerResponse struct {
sdkResponseBase
ReturnObj []*ListenerRecord `json:"returnObj,omitempty"`
ReturnObj []*Listener `json:"returnObj,omitempty"`
}
func (c *Client) ShowListener(req *ShowListenerRequest) (*ShowListenerResponse, error) {

View File

@ -19,7 +19,7 @@ type UpdateListenerRequest struct {
type UpdateListenerResponse struct {
sdkResponseBase
ReturnObj []*ListenerRecord `json:"returnObj,omitempty"`
ReturnObj []*Listener `json:"returnObj,omitempty"`
}
func (c *Client) UpdateListener(req *UpdateListenerRequest) (*UpdateListenerResponse, error) {

View File

@ -0,0 +1,34 @@
package elb
type Certificate struct {
ID string `json:"ID"`
RegionID string `json:"regionID"`
AzName string `json:"azName"`
ProjectID string `json:"projectID"`
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"`
Certificate string `json:"certificate"`
PrivateKey string `json:"privateKey"`
Status string `json:"status"`
CreatedTime string `json:"createdTime"`
UpdatedTime string `json:"updatedTime"`
}
type Listener struct {
ID string `json:"ID"`
RegionID string `json:"regionID"`
AzName string `json:"azName"`
ProjectID string `json:"projectID"`
Name string `json:"name"`
Description string `json:"description"`
LoadBalancerID string `json:"loadBalancerID"`
Protocol string `json:"protocol"`
ProtocolPort int32 `json:"protocolPort"`
CertificateID string `json:"certificateID,omitempty"`
CaEnabled bool `json:"caEnabled"`
ClientCertificateID string `json:"clientCertificateID,omitempty"`
Status string `json:"status"`
CreatedTime string `json:"createdTime"`
UpdatedTime string `json:"updatedTime"`
}

View File

@ -69,36 +69,3 @@ func (r *sdkResponseBase) GetDescription() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type CertificateRecord struct {
ID string `json:"ID"`
RegionID string `json:"regionID"`
AzName string `json:"azName"`
ProjectID string `json:"projectID"`
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"`
Certificate string `json:"certificate"`
PrivateKey string `json:"privateKey"`
Status string `json:"status"`
CreatedTime string `json:"createdTime"`
UpdatedTime string `json:"updatedTime"`
}
type ListenerRecord struct {
ID string `json:"ID"`
RegionID string `json:"regionID"`
AzName string `json:"azName"`
ProjectID string `json:"projectID"`
Name string `json:"name"`
Description string `json:"description"`
LoadBalancerID string `json:"loadBalancerID"`
Protocol string `json:"protocol"`
ProtocolPort int32 `json:"protocolPort"`
CertificateID string `json:"certificateID,omitempty"`
CaEnabled bool `json:"caEnabled"`
ClientCertificateID string `json:"clientCertificateID,omitempty"`
Status string `json:"status"`
CreatedTime string `json:"createdTime"`
UpdatedTime string `json:"updatedTime"`
}

View File

@ -18,7 +18,7 @@ type GetCustomDomainRequest struct {
type GetCustomDomainResponse struct {
sdkResponseBase
ReturnObj *CustomDomainRecord `json:"returnObj,omitempty"`
ReturnObj *CustomDomain `json:"returnObj,omitempty"`
}
func (c *Client) GetCustomDomain(req *GetCustomDomainRequest) (*GetCustomDomainResponse, error) {

View File

@ -19,7 +19,7 @@ type UpdateCustomDomainRequest struct {
type UpdateCustomDomainResponse struct {
sdkResponseBase
ReturnObj *CustomDomainRecord `json:"returnObj,omitempty"`
ReturnObj *CustomDomain `json:"returnObj,omitempty"`
}
func (c *Client) UpdateCustomDomain(req *UpdateCustomDomainRequest) (*UpdateCustomDomainResponse, error) {

View File

@ -0,0 +1,62 @@
package faas
type CustomDomain struct {
DomainName string `json:"domainName"`
Protocol string `json:"protocol"`
AuthConfig *CustomDomainAuthConfig `json:"authConfig,omitempty"`
CertConfig *CustomDomainCertConfig `json:"certConfig,omitempty"`
RouteConfig *CustomDomainRouteConfig `json:"routeConfig,omitempty"`
DomainStatus string `json:"domainStatus"`
CnameValid bool `json:"cnameValid"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type CustomDomainAuthConfig struct {
AuthType string `json:"authType"`
JwtConfig *CustomDomainAuthJwtConfig `json:"jwtConfig,omitempty"`
}
type CustomDomainAuthJwtConfig struct {
Jwks string `json:"jwks"`
TokenConfig *CustomDomainAuthJwtTokenConfig `json:"tokenConfig,omitempty"`
ClaimTrans []*CustomDomainAuthJwtClaimTran `json:"claimTrans,omitempty"`
MatchMode *CustomDomainAuthJwtMatchModeConfig `json:"matchMode,omitempty"`
}
type CustomDomainAuthJwtClaimTran struct {
ClaimName string `json:"claimName"`
TargetName string `json:"targetName"`
TransLocation string `json:"transLocation"`
}
type CustomDomainAuthJwtTokenConfig struct {
Location string `json:"location"`
Name string `json:"name"`
RemovePrefix *string `json:"removePrefix,omitempty"`
}
type CustomDomainAuthJwtMatchModeConfig struct {
Mode string `json:"mode"`
Path []string `json:"path"`
}
type CustomDomainCertConfig struct {
CertName string `json:"certName"`
Certificate string `json:"certificate"`
PrivateKey string `json:"privateKey"`
}
type CustomDomainRouteConfig struct {
Routes []*CustomDomainRoutePathConfig `json:"routes"`
}
type CustomDomainRoutePathConfig struct {
EnableJwt int32 `json:"enableJwt"`
FunctionId int64 `json:"functionId"`
FunctionName string `json:"functionName"`
FunctionUniqueName string `json:"functionUniqueName"`
Methods []string `json:"methods"`
Path string `json:"path"`
Qualifier string `json:"qualifier,omitempty"`
}

View File

@ -69,64 +69,3 @@ func (r *sdkResponseBase) GetErrorMessage() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type CustomDomainRecord struct {
DomainName string `json:"domainName"`
Protocol string `json:"protocol"`
AuthConfig *CustomDomainAuthConfig `json:"authConfig,omitempty"`
CertConfig *CustomDomainCertConfig `json:"certConfig,omitempty"`
RouteConfig *CustomDomainRouteConfig `json:"routeConfig,omitempty"`
DomainStatus string `json:"domainStatus"`
CnameValid bool `json:"cnameValid"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type CustomDomainAuthConfig struct {
AuthType string `json:"authType"`
JwtConfig *CustomDomainAuthJwtConfig `json:"jwtConfig,omitempty"`
}
type CustomDomainAuthJwtConfig struct {
Jwks string `json:"jwks"`
TokenConfig *CustomDomainAuthJwtTokenConfig `json:"tokenConfig,omitempty"`
ClaimTrans []*CustomDomainAuthJwtClaimTran `json:"claimTrans,omitempty"`
MatchMode *CustomDomainAuthJwtMatchModeConfig `json:"matchMode,omitempty"`
}
type CustomDomainAuthJwtClaimTran struct {
ClaimName string `json:"claimName"`
TargetName string `json:"targetName"`
TransLocation string `json:"transLocation"`
}
type CustomDomainAuthJwtTokenConfig struct {
Location string `json:"location"`
Name string `json:"name"`
RemovePrefix *string `json:"removePrefix,omitempty"`
}
type CustomDomainAuthJwtMatchModeConfig struct {
Mode string `json:"mode"`
Path []string `json:"path"`
}
type CustomDomainCertConfig struct {
CertName string `json:"certName"`
Certificate string `json:"certificate"`
PrivateKey string `json:"privateKey"`
}
type CustomDomainRouteConfig struct {
Routes []*CustomDomainRoutePathConfig `json:"routes"`
}
type CustomDomainRoutePathConfig struct {
EnableJwt int32 `json:"enableJwt"`
FunctionId int64 `json:"functionId"`
FunctionName string `json:"functionName"`
FunctionUniqueName string `json:"functionUniqueName"`
Methods []string `json:"methods"`
Path string `json:"path"`
Qualifier string `json:"qualifier,omitempty"`
}

View File

@ -17,11 +17,11 @@ type QueryCertListResponse struct {
sdkResponseBase
ReturnObj *struct {
Results []*CertRecord `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PerPage int32 `json:"per_page,omitempty"`
TotalPage int32 `json:"total_page,omitempty"`
TotalRecords int32 `json:"total_records,omitempty"`
Results []*Cert `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PerPage int32 `json:"per_page,omitempty"`
TotalPage int32 `json:"total_page,omitempty"`
TotalRecords int32 `json:"total_records,omitempty"`
} `json:"returnObj,omitempty"`
}

View File

@ -20,11 +20,11 @@ type QueryDomainListResponse struct {
sdkResponseBase
ReturnObj *struct {
Results []*DomainRecord `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PageSize int32 `json:"page_size,omitempty"`
PageCount int32 `json:"page_count,omitempty"`
Total int32 `json:"total,omitempty"`
Results []*Domain `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PageSize int32 `json:"page_size,omitempty"`
PageCount int32 `json:"page_count,omitempty"`
Total int32 `json:"total,omitempty"`
} `json:"returnObj,omitempty"`
}

View File

@ -0,0 +1,45 @@
package icdn
type Domain struct {
Domain string `json:"domain"`
Cname string `json:"cname"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
AreaScope int32 `json:"area_scope"`
Status int32 `json:"status"`
}
type DomainDetail struct {
Domain
HttpsStatus string `json:"https_status"`
HttpsBasic *DomainHttpsBasicConfig `json:"https_basic,omitempty"`
CertName string `json:"cert_name"`
Ssl string `json:"ssl"`
SslStapling string `json:"ssl_stapling"`
}
type DomainHttpsBasicConfig struct {
HttpsForce string `json:"https_force"`
HttpForce string `json:"http_force"`
ForceStatus string `json:"force_status"`
OriginProtocol string `json:"origin_protocol"`
}
type Cert struct {
Id int64 `json:"id"`
Name string `json:"name"`
CN string `json:"cn"`
SANs []string `json:"sans"`
UsageMode int32 `json:"usage_mode"`
State int32 `json:"state"`
ExpiresTime int64 `json:"expires"`
IssueTime int64 `json:"issue"`
Issuer string `json:"issuer"`
CreatedTime int64 `json:"created"`
}
type CertDetail struct {
Cert
Certs string `json:"certs"`
Key string `json:"key"`
}

View File

@ -69,47 +69,3 @@ func (r *sdkResponseBase) GetErrorMessage() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type DomainRecord struct {
Domain string `json:"domain"`
Cname string `json:"cname"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
AreaScope int32 `json:"area_scope"`
Status int32 `json:"status"`
}
type DomainDetail struct {
DomainRecord
HttpsStatus string `json:"https_status"`
HttpsBasic *DomainHttpsBasicConfig `json:"https_basic,omitempty"`
CertName string `json:"cert_name"`
Ssl string `json:"ssl"`
SslStapling string `json:"ssl_stapling"`
}
type DomainHttpsBasicConfig struct {
HttpsForce string `json:"https_force"`
HttpForce string `json:"http_force"`
ForceStatus string `json:"force_status"`
OriginProtocol string `json:"origin_protocol"`
}
type CertRecord struct {
Id int64 `json:"id"`
Name string `json:"name"`
CN string `json:"cn"`
SANs []string `json:"sans"`
UsageMode int32 `json:"usage_mode"`
State int32 `json:"state"`
ExpiresTime int64 `json:"expires"`
IssueTime int64 `json:"issue"`
Issuer string `json:"issuer"`
CreatedTime int64 `json:"created"`
}
type CertDetail struct {
CertRecord
Certs string `json:"certs"`
Key string `json:"key"`
}

View File

@ -17,11 +17,11 @@ type QueryCertListResponse struct {
sdkResponseBase
ReturnObj *struct {
Results []*CertRecord `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PerPage int32 `json:"per_page,omitempty"`
TotalPage int32 `json:"total_page,omitempty"`
TotalRecords int32 `json:"total_records,omitempty"`
Results []*Cert `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PerPage int32 `json:"per_page,omitempty"`
TotalPage int32 `json:"total_page,omitempty"`
TotalRecords int32 `json:"total_records,omitempty"`
} `json:"returnObj,omitempty"`
}

View File

@ -20,11 +20,11 @@ type QueryDomainListResponse struct {
sdkResponseBase
ReturnObj *struct {
Results []*DomainRecord `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PageSize int32 `json:"page_size,omitempty"`
PageCount int32 `json:"page_count,omitempty"`
Total int32 `json:"total,omitempty"`
Results []*Domain `json:"result,omitempty"`
Page int32 `json:"page,omitempty"`
PageSize int32 `json:"page_size,omitempty"`
PageCount int32 `json:"page_count,omitempty"`
Total int32 `json:"total,omitempty"`
} `json:"returnObj,omitempty"`
}

View File

@ -0,0 +1,35 @@
package lvdn
type Domain struct {
Domain string `json:"domain"`
Cname string `json:"cname"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
AreaScope int32 `json:"area_scope"`
Status int32 `json:"status"`
}
type DomainDetail struct {
Domain
HttpsSwitch int32 `json:"https_switch"`
CertName string `json:"cert_name"`
}
type Cert struct {
Id int64 `json:"id"`
Name string `json:"name"`
CN string `json:"cn"`
SANs []string `json:"sans"`
UsageMode int32 `json:"usage_mode"`
State int32 `json:"state"`
ExpiresTime int64 `json:"expires"`
IssueTime int64 `json:"issue"`
Issuer string `json:"issuer"`
CreatedTime int64 `json:"created"`
}
type CertDetail struct {
Cert
Certs string `json:"certs"`
Key string `json:"key"`
}

View File

@ -69,37 +69,3 @@ func (r *sdkResponseBase) GetErrorMessage() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type DomainRecord struct {
Domain string `json:"domain"`
Cname string `json:"cname"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
AreaScope int32 `json:"area_scope"`
Status int32 `json:"status"`
}
type DomainDetail struct {
DomainRecord
HttpsSwitch int32 `json:"https_switch"`
CertName string `json:"cert_name"`
}
type CertRecord struct {
Id int64 `json:"id"`
Name string `json:"name"`
CN string `json:"cn"`
SANs []string `json:"sans"`
UsageMode int32 `json:"usage_mode"`
State int32 `json:"state"`
ExpiresTime int64 `json:"expires"`
IssueTime int64 `json:"issue"`
Issuer string `json:"issuer"`
CreatedTime int64 `json:"created"`
}
type CertDetail struct {
CertRecord
Certs string `json:"certs"`
Key string `json:"key"`
}

View File

@ -11,7 +11,7 @@ type NginxCreateCertificateRequest struct {
}
type NginxCreateCertificateResponse struct {
CertificateRecord
Certificate
}
func (c *Client) NginxCreateCertificate(req *NginxCreateCertificateRequest) (*NginxCreateCertificateResponse, error) {

View File

@ -11,7 +11,7 @@ type NginxListCertificatesRequest struct {
Expand *string `json:"expand,omitempty" url:"expand,omitempty"`
}
type NginxListCertificatesResponse = []*CertificateRecord
type NginxListCertificatesResponse = []*Certificate
func (c *Client) NginxListCertificates(req *NginxListCertificatesRequest) (*NginxListCertificatesResponse, error) {
return c.NginxListCertificatesWithContext(context.Background(), req)

View File

@ -11,7 +11,7 @@ type NginxListDeadHostsRequest struct {
Expand *string `json:"expand,omitempty" url:"expand,omitempty"`
}
type NginxListDeadHostsResponse = []*DeadHostRecord
type NginxListDeadHostsResponse = []*DeadHost
func (c *Client) NginxListDeadHosts(req *NginxListDeadHostsRequest) (*NginxListDeadHostsResponse, error) {
return c.NginxListDeadHostsWithContext(context.Background(), req)

View File

@ -11,7 +11,7 @@ type NginxListProxyHostsRequest struct {
Expand *string `json:"expand,omitempty" url:"expand,omitempty"`
}
type NginxListProxyHostsResponse = []*ProxyHostRecord
type NginxListProxyHostsResponse = []*ProxyHost
func (c *Client) NginxListProxyHosts(req *NginxListProxyHostsRequest) (*NginxListProxyHostsResponse, error) {
return c.NginxListProxyHostsWithContext(context.Background(), req)

View File

@ -11,7 +11,7 @@ type NginxListRedirectionHostsRequest struct {
Expand *string `json:"expand,omitempty" url:"expand,omitempty"`
}
type NginxListRedirectionHostsResponse = []*RedirectionHostRecord
type NginxListRedirectionHostsResponse = []*RedirectionHost
func (c *Client) NginxListRedirectionHosts(req *NginxListRedirectionHostsRequest) (*NginxListRedirectionHostsResponse, error) {
return c.NginxListRedirectionHostsWithContext(context.Background(), req)

View File

@ -11,7 +11,7 @@ type NginxListStreamsRequest struct {
Expand *string `json:"expand,omitempty" url:"expand,omitempty"`
}
type NginxListStreamsResponse = []*StreamHostRecord
type NginxListStreamsResponse = []*StreamHost
func (c *Client) NginxListStreams(req *NginxListStreamsRequest) (*NginxListStreamsResponse, error) {
return c.NginxListStreamsWithContext(context.Background(), req)

View File

@ -11,7 +11,7 @@ type NginxUpdateDeadHostRequest struct {
}
type NginxUpdateDeadHostResponse struct {
DeadHostRecord
DeadHost
}
func (c *Client) NginxUpdateDeadHost(hostId int64, req *NginxUpdateDeadHostRequest) (*NginxUpdateDeadHostResponse, error) {

View File

@ -11,7 +11,7 @@ type NginxUpdateProxyHostRequest struct {
}
type NginxUpdateProxyHostResponse struct {
ProxyHostRecord
ProxyHost
}
func (c *Client) NginxUpdateProxyHost(hostId int64, req *NginxUpdateProxyHostRequest) (*NginxUpdateProxyHostResponse, error) {

View File

@ -11,7 +11,7 @@ type NginxUpdateRedirectionHostRequest struct {
}
type NginxUpdateRedirectionHostResponse struct {
RedirectionHostRecord
RedirectionHost
}
func (c *Client) NginxUpdateRedirectionHost(hostId int64, req *NginxUpdateRedirectionHostRequest) (*NginxUpdateRedirectionHostResponse, error) {

View File

@ -11,7 +11,7 @@ type NginxUpdateStreamRequest struct {
}
type NginxUpdateStreamResponse struct {
StreamHostRecord
StreamHost
}
func (c *Client) NginxUpdateStream(hostId int64, req *NginxUpdateStreamRequest) (*NginxUpdateStreamResponse, error) {

View File

@ -0,0 +1,72 @@
package nginxproxymanager
type Certificate struct {
Id int64 `json:"id"`
CreatedOn string `json:"created_on"`
ModifiedOn string `json:"modified_on"`
Provider string `json:"provider"`
NiceName string `json:"nice_name"`
DomainNames []string `json:"domain_names"`
ExpiresOn string `json:"expires_on"`
Meta CertificateMeta `json:"meta"`
}
type CertificateMeta struct {
Certificate string `json:"certificate"`
CertificateKey string `json:"certificate_key"`
IntermediateCertificate string `json:"intermediate_certificate"`
}
type Host struct {
Id int64 `json:"id"`
CreatedOn string `json:"created_on"`
ModifiedOn string `json:"modified_on"`
DomainNames []string `json:"domain_names"`
CertificateId int64 `json:"certificate_id"`
Meta HostMeta `json:"meta"`
Enabled bool `json:"enabled"`
}
type HostMeta struct {
NginxOnline bool `json:"nginx_online"`
NginxErr any `json:"nginx_err"`
}
type ProxyHost struct {
Host
ForwardScheme string `json:"forward_scheme"`
ForwardHost string `json:"forward_host"`
ForwardPort int32 `json:"forward_port"`
SslForced bool `json:"ssl_forced"`
Http2Support bool `json:"http2_support"`
HstsEnabled bool `json:"hsts_enabled"`
HstsSubdomains bool `json:"hsts_subdomains"`
}
type RedirectionHost struct {
Host
ForwardScheme string `json:"forward_scheme"`
ForwardDomainName string `json:"forward_domain_name"`
ForwardHttpCode int32 `json:"forward_http_code"`
SslForced bool `json:"ssl_forced"`
Http2Support bool `json:"http2_support"`
HstsEnabled bool `json:"hsts_enabled"`
HstsSubdomains bool `json:"hsts_subdomains"`
}
type StreamHost struct {
Host
ForwardingHost string `json:"forwarding_host"`
ForwardingPort int32 `json:"forwarding_port"`
IncomingPort int32 `json:"incoming_port"`
TcpForwarding bool `json:"tcp_forwarding"`
UdpForwarding bool `json:"udp_forwarding"`
}
type DeadHost struct {
Host
SslForced bool `json:"ssl_forced"`
Http2Support bool `json:"http2_support"`
HstsEnabled bool `json:"hsts_enabled"`
HstsSubdomains bool `json:"hsts_subdomains"`
}

View File

@ -46,74 +46,3 @@ func (r *sdkResponseBase) GetError() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type CertificateRecord struct {
Id int64 `json:"id"`
CreatedOn string `json:"created_on"`
ModifiedOn string `json:"modified_on"`
Provider string `json:"provider"`
NiceName string `json:"nice_name"`
DomainNames []string `json:"domain_names"`
ExpiresOn string `json:"expires_on"`
Meta CertificateMeta `json:"meta"`
}
type CertificateMeta struct {
Certificate string `json:"certificate"`
CertificateKey string `json:"certificate_key"`
IntermediateCertificate string `json:"intermediate_certificate"`
}
type HostRecord struct {
Id int64 `json:"id"`
CreatedOn string `json:"created_on"`
ModifiedOn string `json:"modified_on"`
DomainNames []string `json:"domain_names"`
CertificateId int64 `json:"certificate_id"`
Meta HostMeta `json:"meta"`
Enabled bool `json:"enabled"`
}
type HostMeta struct {
NginxOnline bool `json:"nginx_online"`
NginxErr any `json:"nginx_err"`
}
type ProxyHostRecord struct {
HostRecord
ForwardScheme string `json:"forward_scheme"`
ForwardHost string `json:"forward_host"`
ForwardPort int32 `json:"forward_port"`
SslForced bool `json:"ssl_forced"`
Http2Support bool `json:"http2_support"`
HstsEnabled bool `json:"hsts_enabled"`
HstsSubdomains bool `json:"hsts_subdomains"`
}
type RedirectionHostRecord struct {
HostRecord
ForwardScheme string `json:"forward_scheme"`
ForwardDomainName string `json:"forward_domain_name"`
ForwardHttpCode int32 `json:"forward_http_code"`
SslForced bool `json:"ssl_forced"`
Http2Support bool `json:"http2_support"`
HstsEnabled bool `json:"hsts_enabled"`
HstsSubdomains bool `json:"hsts_subdomains"`
}
type StreamHostRecord struct {
HostRecord
ForwardingHost string `json:"forwarding_host"`
ForwardingPort int32 `json:"forwarding_port"`
IncomingPort int32 `json:"incoming_port"`
TcpForwarding bool `json:"tcp_forwarding"`
UdpForwarding bool `json:"udp_forwarding"`
}
type DeadHostRecord struct {
HostRecord
SslForced bool `json:"ssl_forced"`
Http2Support bool `json:"http2_support"`
HstsEnabled bool `json:"hsts_enabled"`
HstsSubdomains bool `json:"hsts_subdomains"`
}

View File

@ -0,0 +1,16 @@
package dns
type DNSRecord struct {
GroupId *int64 `json:"group_id,omitempty"`
GroupStatus *int32 `json:"group_status,omitempty"`
Value []*DNSRecordValue `json:"value,omitempty"`
Weight *int32 `json:"weight,omitempty"`
}
type DNSRecordValue struct {
Id *int64 `json:"id,omitempty"`
Type *string `json:"type,omitempty"`
Value *string `json:"value,omitempty"`
Line *string `json:"line,omitempty"`
Ttl *int32 `json:"ttl,omitempty"`
}

View File

@ -27,18 +27,3 @@ func (r *sdkResponseBase) GetMessage() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type DnsRecord struct {
GroupId *int64 `json:"group_id,omitempty"`
GroupStatus *int32 `json:"group_status,omitempty"`
Value []*DnsRecordValue `json:"value,omitempty"`
Weight *int32 `json:"weight,omitempty"`
}
type DnsRecordValue struct {
Id *int64 `json:"id,omitempty"`
Type *string `json:"type,omitempty"`
Value *string `json:"value,omitempty"`
Line *string `json:"line,omitempty"`
Ttl *int32 `json:"ttl,omitempty"`
}

View File

@ -9,7 +9,7 @@ import (
type SslCenterGetResponse struct {
sdkResponseBase
Data *SslDetail `json:"data,omitempty"`
Data *SSLCertificateDetail `json:"data,omitempty"`
}
func (c *Client) SslCenterGet(sslId int64) (*SslCenterGetResponse, error) {

View File

@ -21,8 +21,8 @@ type SslCenterListResponse struct {
sdkResponseBase
Data *struct {
TotalRecords int32 `json:"TotalRecords"`
Records []*SslRecord `json:"Records"`
TotalRecords int32 `json:"TotalRecords"`
Records []*SSLCertificate `json:"Records"`
} `json:"data,omitempty"`
}

View File

@ -0,0 +1,21 @@
package rainyun
type SSLCertificate struct {
ID int64 `json:"ID"`
UID int64 `json:"UID"`
Domain string `json:"Domain"`
Issuer string `json:"Issuer"`
StartDate int64 `json:"StartDate"`
ExpireDate int64 `json:"ExpDate"`
UploadTime int64 `json:"UploadTime"`
}
type SSLCertificateDetail struct {
Cert string `json:"Cert"`
Key string `json:"Key"`
Domain string `json:"DomainName"`
Issuer string `json:"Issuer"`
StartDate int64 `json:"StartDate"`
ExpireDate int64 `json:"ExpDate"`
RemainDays int64 `json:"RemainDays"`
}

View File

@ -27,23 +27,3 @@ func (r *sdkResponseBase) GetMessage() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type SslRecord struct {
ID int64 `json:"ID"`
UID int64 `json:"UID"`
Domain string `json:"Domain"`
Issuer string `json:"Issuer"`
StartDate int64 `json:"StartDate"`
ExpireDate int64 `json:"ExpDate"`
UploadTime int64 `json:"UploadTime"`
}
type SslDetail struct {
Cert string `json:"Cert"`
Key string `json:"Key"`
Domain string `json:"DomainName"`
Issuer string `json:"Issuer"`
StartDate int64 `json:"StartDate"`
ExpireDate int64 `json:"ExpDate"`
RemainDays int64 `json:"RemainDays"`
}

View File

@ -0,0 +1,6 @@
package safeline
type CertificateManul struct {
Crt string `json:"crt"`
Key string `json:"key"`
}

View File

@ -27,8 +27,3 @@ func (r *sdkResponseBase) GetErrMsg() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type CertificateManul struct {
Crt string `json:"crt"`
Key string `json:"key"`
}

View File

@ -8,7 +8,7 @@ import (
type SslConfigDetailResponse struct {
sdkResponseBase
Data *SslConfig `json:"data,omitempty"`
Data *SSLConfig `json:"data,omitempty"`
}
func (c *Client) SslConfigDetail(sslId string) (*SslConfigDetailResponse, error) {

View File

@ -0,0 +1,17 @@
package samwaf
type SSLConfig struct {
Id string `json:"id"`
CertContent string `json:"cert_content"`
KeyContent string `json:"key_content"`
SerialNo string `json:"serial_no"`
Subject string `json:"subject"`
Issuer string `json:"issuer"`
ValidFrom string `json:"valid_from"`
ValidTo string `json:"valid_to"`
Domains string `json:"domains"`
KeyPath string `json:"key_path"`
CertPath string `json:"cert_path"`
CreateTime string `json:"create_time"`
UpdateTime string `json:"update_time"`
}

View File

@ -19,19 +19,3 @@ func (r *sdkResponseBase) GetMsg() string {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type SslConfig struct {
Id string `json:"id"`
CertContent string `json:"cert_content"`
KeyContent string `json:"key_content"`
SerialNo string `json:"serial_no"`
Subject string `json:"subject"`
Issuer string `json:"issuer"`
ValidFrom string `json:"valid_from"`
ValidTo string `json:"valid_to"`
Domains string `json:"domains"`
KeyPath string `json:"key_path"`
CertPath string `json:"cert_path"`
CreateTime string `json:"create_time"`
UpdateTime string `json:"update_time"`
}

View File

@ -0,0 +1,39 @@
package synologydsm
type APIInfo struct {
Path string `json:"path"`
MinVersion int `json:"minVersion"`
MaxVersion int `json:"maxVersion"`
}
type CertificateInfo struct {
ID string `json:"id"`
Description string `json:"desc"`
IsDefault bool `json:"is_default"`
IsBroken bool `json:"is_broken"`
Issuer struct {
CommonName string `json:"common_name"`
Country string `json:"country"`
Organization string `json:"organization"`
} `json:"issuer"`
Subject struct {
CommonName string `json:"common_name"`
Country string `json:"country"`
Organization string `json:"organization"`
SAN []string `json:"sub_alt_name"`
} `json:"subject"`
ValidFrom string `json:"valid_from"`
ValidTill string `json:"valid_till"`
SignatureAlgorithm string `json:"signature_algorithm"`
Renewable bool `json:"renewable"`
Services []*CertificateService `json:"services"`
}
type CertificateService struct {
DisplayName string `json:"display_name"`
DisplayNameI18N string `json:"display_name_i18n,omitempty"`
IsPkg bool `json:"isPkg"`
Owner string `json:"owner"`
Service string `json:"service"`
Subscriber string `json:"subscriber"`
}

View File

@ -6,8 +6,10 @@ type sdkResponse interface {
}
type sdkResponseBase struct {
Success bool `json:"success"`
Error *APIError `json:"error,omitempty"`
Success bool `json:"success"`
Error *struct {
Code int `json:"code,omitempty"`
} `json:"error,omitempty"`
}
func (r *sdkResponseBase) GetSuccess() bool {
@ -26,45 +28,3 @@ func (r *sdkResponseBase) GetErrorCode() int {
}
var _ sdkResponse = (*sdkResponseBase)(nil)
type APIError struct {
Code int `json:"code,omitempty"`
}
type APIInfo struct {
Path string `json:"path"`
MinVersion int `json:"minVersion"`
MaxVersion int `json:"maxVersion"`
}
type CertificateInfo struct {
ID string `json:"id"`
Description string `json:"desc"`
IsDefault bool `json:"is_default"`
IsBroken bool `json:"is_broken"`
Issuer struct {
CommonName string `json:"common_name"`
Country string `json:"country"`
Organization string `json:"organization"`
} `json:"issuer"`
Subject struct {
CommonName string `json:"common_name"`
Country string `json:"country"`
Organization string `json:"organization"`
SAN []string `json:"sub_alt_name"`
} `json:"subject"`
ValidFrom string `json:"valid_from"`
ValidTill string `json:"valid_till"`
SignatureAlgorithm string `json:"signature_algorithm"`
Renewable bool `json:"renewable"`
Services []*CertificateService `json:"services"`
}
type CertificateService struct {
DisplayName string `json:"display_name"`
DisplayNameI18N string `json:"display_name_i18n,omitempty"`
IsPkg bool `json:"isPkg"`
Owner string `json:"owner"`
Service string `json:"service"`
Subscriber string `json:"subscriber"`
}

View File

@ -7,12 +7,12 @@ import (
)
type CreateCertificateRequest struct {
Timestamp int64 `json:"-"`
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
AutoRenew *string `json:"autoRenew,omitempty"`
ForceRenew *bool `json:"forceRenew,omitempty"`
NewVersion *CertificateVersionInfo `json:"newVersion,omitempty"`
Timestamp int64 `json:"-"`
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
AutoRenew *string `json:"autoRenew,omitempty"`
ForceRenew *bool `json:"forceRenew,omitempty"`
NewVersion *CertificateVersion `json:"newVersion,omitempty"`
}
type CreateCertificateResponse struct {

View File

@ -6,10 +6,10 @@ import (
)
type CreateDeploymentTaskRequest struct {
Name *string `json:"name,omitempty"`
Target *string `json:"target,omitempty"`
Actions *[]DeploymentTaskActionInfo `json:"actions,omitempty"`
Webhook *string `json:"webhook,omitempty"`
Name *string `json:"name,omitempty"`
Target *string `json:"target,omitempty"`
Actions *[]DeploymentTaskAction `json:"actions,omitempty"`
Webhook *string `json:"webhook,omitempty"`
}
type CreateDeploymentTaskResponse struct {

View File

@ -10,14 +10,14 @@ import (
type GetDeploymentTaskDetailResponse struct {
sdkResponseBase
Name string `json:"name"`
Target string `json:"target"`
Actions []DeploymentTaskActionInfo `json:"actions"`
Status string `json:"status"`
StatusDetails string `json:"statusDetails"`
SubmissionTime string `json:"submissionTime"`
FinishTime string `json:"finishTime"`
ApiRequestId string `json:"apiRequestId"`
Name string `json:"name"`
Target string `json:"target"`
Actions []DeploymentTaskAction `json:"actions"`
Status string `json:"status"`
StatusDetails string `json:"statusDetails"`
SubmissionTime string `json:"submissionTime"`
FinishTime string `json:"finishTime"`
ApiRequestId string `json:"apiRequestId"`
}
func (c *Client) GetDeploymentTaskDetail(deploymentTaskId string) (*GetDeploymentTaskDetailResponse, error) {

View File

@ -10,9 +10,9 @@ import (
type GetHostnameDetailResponse struct {
sdkResponseBase
Hostname string `json:"hostname"`
PropertyInProduction *HostnamePropertyInfo `json:"propertyInProduction,omitempty"`
PropertyInStaging *HostnamePropertyInfo `json:"propertyInStaging,omitempty"`
Hostname string `json:"hostname"`
PropertyInProduction *HostnameProperty `json:"propertyInProduction,omitempty"`
PropertyInStaging *HostnameProperty `json:"propertyInStaging,omitempty"`
}
func (c *Client) GetHostnameDetail(hostname string) (*GetHostnameDetailResponse, error) {

View File

@ -8,12 +8,12 @@ import (
)
type UpdateCertificateRequest struct {
Timestamp int64 `json:"-"`
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
AutoRenew *string `json:"autoRenew,omitempty"`
ForceRenew *bool `json:"forceRenew,omitempty"`
NewVersion *CertificateVersionInfo `json:"newVersion,omitempty"`
Timestamp int64 `json:"-"`
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
AutoRenew *string `json:"autoRenew,omitempty"`
ForceRenew *bool `json:"forceRenew,omitempty"`
NewVersion *CertificateVersion `json:"newVersion,omitempty"`
}
type UpdateCertificateResponse struct {

View File

@ -0,0 +1,33 @@
package cdnpro
type CertificateVersion struct {
Comments *string `json:"comments,omitempty"`
PrivateKey *string `json:"privateKey,omitempty"`
Certificate *string `json:"certificate,omitempty"`
ChainCert *string `json:"chainCert,omitempty"`
IdentificationInfo *CertificateVersionIdentificationInfo `json:"identificationInfo,omitempty"`
}
type CertificateVersionIdentificationInfo struct {
Country *string `json:"country,omitempty"`
State *string `json:"state,omitempty"`
City *string `json:"city,omitempty"`
Company *string `json:"company,omitempty"`
Department *string `json:"department,omitempty"`
CommonName *string `json:"commonName,omitempty"`
Email *string `json:"email,omitempty"`
SubjectAlternativeNames []*string `json:"subjectAlternativeNames,omitempty"`
}
type HostnameProperty struct {
PropertyId string `json:"propertyId"`
Version int32 `json:"version"`
CertificateId *string `json:"certificateId,omitempty"`
}
type DeploymentTaskAction struct {
Action *string `json:"action,omitempty"`
PropertyId *string `json:"propertyId,omitempty"`
CertificateId *string `json:"certificateId,omitempty"`
Version *int32 `json:"version,omitempty"`
}

View File

@ -27,35 +27,3 @@ func (r *sdkResponseBase) GetMessage() string {
return *r.Message
}
type CertificateVersionInfo struct {
Comments *string `json:"comments,omitempty"`
PrivateKey *string `json:"privateKey,omitempty"`
Certificate *string `json:"certificate,omitempty"`
ChainCert *string `json:"chainCert,omitempty"`
IdentificationInfo *CertificateVersionIdentificationInfo `json:"identificationInfo,omitempty"`
}
type CertificateVersionIdentificationInfo struct {
Country *string `json:"country,omitempty"`
State *string `json:"state,omitempty"`
City *string `json:"city,omitempty"`
Company *string `json:"company,omitempty"`
Department *string `json:"department,omitempty"`
CommonName *string `json:"commonName,omitempty"`
Email *string `json:"email,omitempty"`
SubjectAlternativeNames []*string `json:"subjectAlternativeNames,omitempty"`
}
type HostnamePropertyInfo struct {
PropertyId string `json:"propertyId"`
Version int32 `json:"version"`
CertificateId *string `json:"certificateId,omitempty"`
}
type DeploymentTaskActionInfo struct {
Action *string `json:"action,omitempty"`
PropertyId *string `json:"propertyId,omitempty"`
CertificateId *string `json:"certificateId,omitempty"`
Version *int32 `json:"version,omitempty"`
}

View File

@ -8,7 +8,7 @@ import (
type ListCertificatesResponse struct {
sdkResponseBase
Certificates []*CertificateRecord `json:"ssl-certificates,omitempty"`
Certificates []*Certificate `json:"ssl-certificates,omitempty"`
}
func (c *Client) ListCertificates() (*ListCertificatesResponse, error) {

View File

@ -0,0 +1,10 @@
package certificate
type Certificate struct {
Id string `json:"certificate-id"`
Name string `json:"name"`
Comment string `json:"comment"`
ValidityFrom string `json:"certificate-validity-from"`
ValidityTo string `json:"certificate-validity-to"`
Serial string `json:"certificate-serial"`
}

View File

@ -27,12 +27,3 @@ func (r *sdkResponseBase) GetMessage() string {
return *r.Message
}
type CertificateRecord struct {
CertificateId string `json:"certificate-id"`
Name string `json:"name"`
Comment string `json:"comment"`
ValidityFrom string `json:"certificate-validity-from"`
ValidityTo string `json:"certificate-validity-to"`
Serial string `json:"certificate-serial"`
}