feat: add cdnfly deployer
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -34,7 +33,7 @@ var _ uploader.Uploader = (*AliyunCASUploader)(nil)
|
||||
|
||||
func New(config *AliyunCASUploaderConfig) (*AliyunCASUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
@@ -37,7 +36,7 @@ var _ uploader.Uploader = (*AliyunSLBUploader)(nil)
|
||||
|
||||
func New(config *AliyunSLBUploaderConfig) (*AliyunSLBUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@@ -34,7 +33,7 @@ var _ uploader.Uploader = (*AWSCertificateManagerUploader)(nil)
|
||||
|
||||
func New(config *AWSCertificateManagerUploaderConfig) (*AWSCertificateManagerUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.AccessKeyId, config.SecretAccessKey, config.Region)
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"crypto/sha1"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -33,7 +32,7 @@ var _ uploader.Uploader = (*ByteplusCDNUploader)(nil)
|
||||
|
||||
func New(config *ByteplusCDNUploaderConfig) (*ByteplusCDNUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client := bpCdn.NewInstance()
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@@ -28,7 +27,7 @@ var _ uploader.Uploader = (*DogeCloudUploader)(nil)
|
||||
|
||||
func New(config *DogeCloudUploaderConfig) (*DogeCloudUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(
|
||||
|
||||
@@ -28,7 +28,7 @@ var _ uploader.Uploader = (*GcoreCDNUploader)(nil)
|
||||
|
||||
func New(config *GcoreCDNUploaderConfig) (*GcoreCDNUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiToken)
|
||||
@@ -70,6 +70,10 @@ func (u *GcoreCDNUploader) Upload(ctx context.Context, certPem string, privkeyPe
|
||||
}
|
||||
|
||||
func createSdkClient(apiToken string) (*gsslcerts.Service, error) {
|
||||
if apiToken == "" {
|
||||
return nil, errors.New("invalid gcore api token")
|
||||
}
|
||||
|
||||
requester := gprovider.NewClient(
|
||||
gcoresdk.BASE_URL,
|
||||
gprovider.WithSigner(gcoresdk.NewAuthRequestSigner(apiToken)),
|
||||
|
||||
@@ -39,7 +39,7 @@ var _ uploader.Uploader = (*HuaweiCloudELBUploader)(nil)
|
||||
|
||||
func New(config *HuaweiCloudELBUploaderConfig) (*HuaweiCloudELBUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@@ -35,7 +34,7 @@ var _ uploader.Uploader = (*HuaweiCloudSCMUploader)(nil)
|
||||
|
||||
func New(config *HuaweiCloudSCMUploaderConfig) (*HuaweiCloudSCMUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(
|
||||
|
||||
@@ -39,7 +39,7 @@ var _ uploader.Uploader = (*HuaweiCloudWAFUploader)(nil)
|
||||
|
||||
func New(config *HuaweiCloudWAFUploaderConfig) (*HuaweiCloudWAFUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@@ -30,7 +29,7 @@ var _ uploader.Uploader = (*QiniuSSLCertUploader)(nil)
|
||||
|
||||
func New(config *QiniuSSLCertUploaderConfig) (*QiniuSSLCertUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
xerrors "github.com/pkg/errors"
|
||||
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
|
||||
@@ -28,7 +27,7 @@ var _ uploader.Uploader = (*TencentCloudSSLUploader)(nil)
|
||||
|
||||
func New(config *TencentCloudSSLUploaderConfig) (*TencentCloudSSLUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(
|
||||
|
||||
@@ -38,7 +38,7 @@ var _ uploader.Uploader = (*UCloudUSSLUploader)(nil)
|
||||
|
||||
func New(config *UCloudUSSLUploaderConfig) (*UCloudUSSLUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.PrivateKey, config.PublicKey)
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"crypto/sha1"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -34,7 +33,7 @@ var _ uploader.Uploader = (*VolcEngineCDNUploader)(nil)
|
||||
|
||||
func New(config *VolcEngineCDNUploaderConfig) (*VolcEngineCDNUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client := veCdn.NewInstance()
|
||||
|
||||
@@ -2,7 +2,6 @@ package volcenginecertcenter
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
xerrors "github.com/pkg/errors"
|
||||
ve "github.com/volcengine/volcengine-go-sdk/volcengine"
|
||||
@@ -30,7 +29,7 @@ var _ uploader.Uploader = (*VolcEngineCertCenterUploader)(nil)
|
||||
|
||||
func New(config *VolcEngineCertCenterUploaderConfig) (*VolcEngineCertCenterUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.AccessKeyId, config.AccessKeySecret, config.Region)
|
||||
|
||||
@@ -2,7 +2,6 @@ package volcenginelive
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -31,7 +30,7 @@ var _ uploader.Uploader = (*VolcEngineLiveUploader)(nil)
|
||||
|
||||
func New(config *VolcEngineLiveUploaderConfig) (*VolcEngineLiveUploader, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client := veLive.NewInstance()
|
||||
|
||||
Reference in New Issue
Block a user