Skip to content

Commit 55aee7b

Browse files
committed
feat(aliyun): 添加Windows平台支持的阿里云提供商实现,防止 ci 失败
1 parent 7fafa7b commit 55aee7b

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

internal/client/providers/aliyun/aliyun.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
调试控制台:https://next.api.aliyun.com/api/cas/2020-04-07/UploadUserCertificate
44
*/
55

6+
//go:build !windows
7+
68
package aliyun
79

810
import (

internal/client/providers/aliyun/aliyun_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build !windows
2+
13
package aliyun_test
24

35
import (
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
//go:build windows
2+
3+
package aliyun
4+
5+
import (
6+
"fmt"
7+
8+
"github.com/orange-juzipi/cert-deploy/internal/client/providers"
9+
)
10+
11+
var _ providers.ProviderHandler = (*Provider)(nil)
12+
13+
type Provider struct {
14+
AccessKeyId string
15+
AccessKeySecret string
16+
}
17+
18+
// New 创建实例
19+
func New(accessKeyId, accessKeySecret string) (*Provider, error) {
20+
return &Provider{
21+
AccessKeyId: accessKeyId,
22+
AccessKeySecret: accessKeySecret,
23+
}, nil
24+
}
25+
26+
// TestConnection 测试连接
27+
func (p *Provider) TestConnection() (bool, error) {
28+
return false, fmt.Errorf("阿里云 provider 不支持 Windows 平台")
29+
}
30+
31+
// UploadCertificate 上传证书
32+
func (p *Provider) UploadCertificate(name, cert, key string) error {
33+
return fmt.Errorf("阿里云 provider 不支持 Windows 平台")
34+
}
35+
36+
// DeployToOSS 部署证书到 OSS
37+
func (p *Provider) DeployToOSS(certID string, domain string) (string, error) {
38+
return "", fmt.Errorf("阿里云 provider 不支持 Windows 平台")
39+
}
40+
41+
// DeployToCDN 部署证书到 CDN
42+
func (p *Provider) DeployToCDN(certID string, domain string) (string, error) {
43+
return "", fmt.Errorf("阿里云 provider 不支持 Windows 平台")
44+
}
45+
46+
// DeployToDCND 部署证书到 DCND
47+
func (p *Provider) DeployToDCND(certID string, domain string) (string, error) {
48+
return "", fmt.Errorf("阿里云 provider 不支持 Windows 平台")
49+
}

0 commit comments

Comments
 (0)