refactor: clean code
This commit is contained in:
@@ -11,111 +11,81 @@ type Access struct {
|
||||
DeletedAt time.Time `json:"deleted" db:"deleted"`
|
||||
}
|
||||
|
||||
type AccessProviderType string
|
||||
|
||||
/*
|
||||
提供商类型常量值。
|
||||
|
||||
注意:如果追加新的常量值,请保持以 ASCII 排序。
|
||||
NOTICE: If you add new constant, please keep ASCII order.
|
||||
*/
|
||||
const (
|
||||
ACCESS_PROVIDER_ACMEHTTPREQ = AccessProviderType("acmehttpreq")
|
||||
ACCESS_PROVIDER_ALIYUN = AccessProviderType("aliyun")
|
||||
ACCESS_PROVIDER_AWS = AccessProviderType("aws")
|
||||
ACCESS_PROVIDER_BAIDUCLOUD = AccessProviderType("baiducloud")
|
||||
ACCESS_PROVIDER_BYTEPLUS = AccessProviderType("byteplus")
|
||||
ACCESS_PROVIDER_CLOUDFLARE = AccessProviderType("cloudflare")
|
||||
ACCESS_PROVIDER_DOGECLOUD = AccessProviderType("dogecloud")
|
||||
ACCESS_PROVIDER_GODADDY = AccessProviderType("godaddy")
|
||||
ACCESS_PROVIDER_HUAWEICLOUD = AccessProviderType("huaweicloud")
|
||||
ACCESS_PROVIDER_KUBERNETES = AccessProviderType("k8s")
|
||||
ACCESS_PROVIDER_LOCAL = AccessProviderType("local")
|
||||
ACCESS_PROVIDER_NAMEDOTCOM = AccessProviderType("namedotcom")
|
||||
ACCESS_PROVIDER_NAMESILO = AccessProviderType("namesilo")
|
||||
ACCESS_PROVIDER_POWERDNS = AccessProviderType("powerdns")
|
||||
ACCESS_PROVIDER_QINIU = AccessProviderType("qiniu")
|
||||
ACCESS_PROVIDER_SSH = AccessProviderType("ssh")
|
||||
ACCESS_PROVIDER_TENCENTCLOUD = AccessProviderType("tencentcloud")
|
||||
ACCESS_PROVIDER_VOLCENGINE = AccessProviderType("volcengine")
|
||||
ACCESS_PROVIDER_WEBHOOK = AccessProviderType("webhook")
|
||||
)
|
||||
|
||||
type ACMEHttpReqAccessConfig struct {
|
||||
type AccessConfigForACMEHttpReq struct {
|
||||
Endpoint string `json:"endpoint"`
|
||||
Mode string `json:"mode"`
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type AliyunAccessConfig struct {
|
||||
type AccessConfigForAliyun struct {
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
}
|
||||
|
||||
type AWSAccessConfig struct {
|
||||
type AccessConfigForAWS struct {
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
Region string `json:"region"`
|
||||
HostedZoneId string `json:"hostedZoneId"`
|
||||
}
|
||||
|
||||
type BaiduCloudAccessConfig struct {
|
||||
type AccessConfigForBaiduCloud struct {
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
}
|
||||
|
||||
type BytePlusAccessConfig struct {
|
||||
type AccessConfigForBytePlus struct {
|
||||
AccessKey string `json:"accessKey"`
|
||||
SecretKey string `json:"secretKey"`
|
||||
}
|
||||
|
||||
type CloudflareAccessConfig struct {
|
||||
type AccessConfigForCloudflare struct {
|
||||
DnsApiToken string `json:"dnsApiToken"`
|
||||
}
|
||||
|
||||
type DogeCloudAccessConfig struct {
|
||||
type AccessConfigForDogeCloud struct {
|
||||
AccessKey string `json:"accessKey"`
|
||||
SecretKey string `json:"secretKey"`
|
||||
}
|
||||
|
||||
type GoDaddyAccessConfig struct {
|
||||
type AccessConfigForGoDaddy struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
ApiSecret string `json:"apiSecret"`
|
||||
}
|
||||
|
||||
type HuaweiCloudAccessConfig struct {
|
||||
type AccessConfigForHuaweiCloud struct {
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
Region string `json:"region"`
|
||||
}
|
||||
|
||||
type LocalAccessConfig struct{}
|
||||
type AccessConfigForLocal struct{}
|
||||
|
||||
type KubernetesAccessConfig struct {
|
||||
type AccessConfigForKubernetes struct {
|
||||
KubeConfig string `json:"kubeConfig"`
|
||||
}
|
||||
|
||||
type NameDotComAccessConfig struct {
|
||||
type AccessConfigForNameDotCom struct {
|
||||
Username string `json:"username"`
|
||||
ApiToken string `json:"apiToken"`
|
||||
}
|
||||
|
||||
type NameSiloAccessConfig struct {
|
||||
type AccessConfigForNameSilo struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
}
|
||||
|
||||
type PowerDNSAccessConfig struct {
|
||||
type AccessConfigForPowerDNS struct {
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
ApiKey string `json:"apiKey"`
|
||||
}
|
||||
|
||||
type QiniuAccessConfig struct {
|
||||
type AccessConfigForQiniu struct {
|
||||
AccessKey string `json:"accessKey"`
|
||||
SecretKey string `json:"secretKey"`
|
||||
}
|
||||
|
||||
type SSHAccessConfig struct {
|
||||
type AccessConfigForSSH struct {
|
||||
Host string `json:"host"`
|
||||
Port string `json:"port"`
|
||||
Username string `json:"username"`
|
||||
@@ -124,16 +94,16 @@ type SSHAccessConfig struct {
|
||||
KeyPassphrase string `json:"keyPassphrase"`
|
||||
}
|
||||
|
||||
type TencentCloudAccessConfig struct {
|
||||
type AccessConfigForTencentCloud struct {
|
||||
SecretId string `json:"secretId"`
|
||||
SecretKey string `json:"secretKey"`
|
||||
}
|
||||
|
||||
type VolcEngineAccessConfig struct {
|
||||
type AccessConfigForVolcEngine struct {
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
}
|
||||
|
||||
type WebhookAccessConfig struct {
|
||||
type AccessConfigForWebhook struct {
|
||||
Url string `json:"url"`
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ type Certificate struct {
|
||||
IssuerCertificate string `json:"issuerCertificate" db:"issuerCertificate"`
|
||||
EffectAt time.Time `json:"effectAt" db:"effectAt"`
|
||||
ExpireAt time.Time `json:"expireAt" db:"expireAt"`
|
||||
AcmeCertUrl string `json:"acmeCertUrl" db:"acmeCertUrl"`
|
||||
AcmeCertStableUrl string `json:"acmeCertStableUrl" db:"acmeCertStableUrl"`
|
||||
ACMECertUrl string `json:"acmeCertUrl" db:"acmeCertUrl"`
|
||||
ACMECertStableUrl string `json:"acmeCertStableUrl" db:"acmeCertStableUrl"`
|
||||
WorkflowId string `json:"workflowId" db:"workflowId"`
|
||||
WorkflowNodeId string `json:"workflowNodeId" db:"workflowNodeId"`
|
||||
WorkflowOutputId string `json:"workflowOutputId" db:"workflowOutputId"`
|
||||
|
||||
@@ -9,14 +9,14 @@ type NotifyChannelType string
|
||||
NOTICE: If you add new constant, please keep ASCII order.
|
||||
*/
|
||||
const (
|
||||
NOTIFY_CHANNEL_BARK = NotifyChannelType("bark")
|
||||
NOTIFY_CHANNEL_DINGTALK = NotifyChannelType("dingtalk")
|
||||
NOTIFY_CHANNEL_EMAIL = NotifyChannelType("email")
|
||||
NOTIFY_CHANNEL_LARK = NotifyChannelType("lark")
|
||||
NOTIFY_CHANNEL_SERVERCHAN = NotifyChannelType("serverchan")
|
||||
NOTIFY_CHANNEL_TELEGRAM = NotifyChannelType("telegram")
|
||||
NOTIFY_CHANNEL_WEBHOOK = NotifyChannelType("webhook")
|
||||
NOTIFY_CHANNEL_WECOM = NotifyChannelType("wecom")
|
||||
NotifyChannelTypeBark = NotifyChannelType("bark")
|
||||
NotifyChannelTypeDingTalk = NotifyChannelType("dingtalk")
|
||||
NotifyChannelTypeEmail = NotifyChannelType("email")
|
||||
NotifyChannelTypeLark = NotifyChannelType("lark")
|
||||
NotifyChannelTypeServerChan = NotifyChannelType("serverchan")
|
||||
NotifyChannelTypeTelegram = NotifyChannelType("telegram")
|
||||
NotifyChannelTypeWebhook = NotifyChannelType("webhook")
|
||||
NotifyChannelTypeWeCom = NotifyChannelType("wecom")
|
||||
)
|
||||
|
||||
type NotifyTestPushReq struct {
|
||||
|
||||
66
internal/domain/provider.go
Normal file
66
internal/domain/provider.go
Normal file
@@ -0,0 +1,66 @@
|
||||
package domain
|
||||
|
||||
type AccessProviderType string
|
||||
|
||||
/*
|
||||
提供商类型常量值。
|
||||
|
||||
注意:如果追加新的常量值,请保持以 ASCII 排序。
|
||||
NOTICE: If you add new constant, please keep ASCII order.
|
||||
*/
|
||||
const (
|
||||
AccessProviderTypeACMEHttpReq = AccessProviderType("acmehttpreq")
|
||||
AccessProviderTypeAliyun = AccessProviderType("aliyun")
|
||||
AccessProviderTypeAWS = AccessProviderType("aws")
|
||||
AccessProviderTypeBaiduCloud = AccessProviderType("baiducloud")
|
||||
AccessProviderTypeBytePlus = AccessProviderType("byteplus")
|
||||
AccessProviderTypeCloudflare = AccessProviderType("cloudflare")
|
||||
AccessProviderTypeDogeCloud = AccessProviderType("dogecloud")
|
||||
AccessProviderTypeGoDaddy = AccessProviderType("godaddy")
|
||||
AccessProviderTypeHuaweiCloud = AccessProviderType("huaweicloud")
|
||||
AccessProviderTypeKubernetes = AccessProviderType("k8s")
|
||||
AccessProviderTypeLocal = AccessProviderType("local")
|
||||
AccessProviderTypeNameDotCom = AccessProviderType("namedotcom")
|
||||
AccessProviderTypeNameSilo = AccessProviderType("namesilo")
|
||||
AccessProviderTypePowerDNS = AccessProviderType("powerdns")
|
||||
AccessProviderTypeQiniu = AccessProviderType("qiniu")
|
||||
AccessProviderTypeSSH = AccessProviderType("ssh")
|
||||
AccessProviderTypeTencentCloud = AccessProviderType("tencentcloud")
|
||||
AccessProviderTypeVolcEngine = AccessProviderType("volcengine")
|
||||
AccessProviderTypeWebhook = AccessProviderType("webhook")
|
||||
)
|
||||
|
||||
type DeployProviderType string
|
||||
|
||||
/*
|
||||
提供商部署目标常量值。
|
||||
短横线前的部分始终等于提供商类型。
|
||||
|
||||
注意:如果追加新的常量值,请保持以 ASCII 排序。
|
||||
NOTICE: If you add new constant, please keep ASCII order.
|
||||
*/
|
||||
const (
|
||||
DeployProviderTypeAliyunALB = DeployProviderType("aliyun-alb")
|
||||
DeployProviderTypeAliyunCDN = DeployProviderType("aliyun-cdn")
|
||||
DeployProviderTypeAliyunCLB = DeployProviderType("aliyun-clb")
|
||||
DeployProviderTypeAliyunDCDN = DeployProviderType("aliyun-dcdn")
|
||||
DeployProviderTypeAliyunNLB = DeployProviderType("aliyun-nlb")
|
||||
DeployProviderTypeAliyunOSS = DeployProviderType("aliyun-oss")
|
||||
DeployProviderTypeBaiduCloudCDN = DeployProviderType("baiducloud-cdn")
|
||||
DeployProviderTypeBytePlusCDN = DeployProviderType("byteplus-cdn")
|
||||
DeployProviderTypeDogeCloudCDN = DeployProviderType("dogecloud-cdn")
|
||||
DeployProviderTypeHuaweiCloudCDN = DeployProviderType("huaweicloud-cdn")
|
||||
DeployProviderTypeHuaweiCloudELB = DeployProviderType("huaweicloud-elb")
|
||||
DeployProviderTypeK8sSecret = DeployProviderType("k8s-secret")
|
||||
DeployProviderTypeLocal = DeployProviderType("local")
|
||||
DeployProviderTypeQiniuCDN = DeployProviderType("qiniu-cdn")
|
||||
DeployProviderTypeSSH = DeployProviderType("ssh")
|
||||
DeployProviderTypeTencentCloudCDN = DeployProviderType("tencentcloud-cdn")
|
||||
DeployProviderTypeTencentCloudCLB = DeployProviderType("tencentcloud-clb")
|
||||
DeployProviderTypeTencentCloudCOS = DeployProviderType("tencentcloud-cos")
|
||||
DeployProviderTypeTencentCloudECDN = DeployProviderType("tencentcloud-ecdn")
|
||||
DeployProviderTypeTencentCloudEO = DeployProviderType("tencentcloud-eo")
|
||||
DeployProviderTypeVolcEngineCDN = DeployProviderType("volcengine-cdn")
|
||||
DeployProviderTypeVolcEngineLive = DeployProviderType("volcengine-live")
|
||||
DeployProviderTypeWebhook = DeployProviderType("webhook")
|
||||
)
|
||||
@@ -1,7 +1,5 @@
|
||||
package domain
|
||||
|
||||
const WorkflowOutputCertificate = "certificate"
|
||||
|
||||
type WorkflowOutput struct {
|
||||
Meta
|
||||
WorkflowId string `json:"workflowId" db:"workflow"`
|
||||
@@ -10,3 +8,5 @@ type WorkflowOutput struct {
|
||||
Outputs []WorkflowNodeIO `json:"outputs" db:"outputs"`
|
||||
Succeeded bool `json:"succeeded" db:"succeeded"`
|
||||
}
|
||||
|
||||
const WORKFLOW_OUTPUT_CERTIFICATE = "certificate"
|
||||
|
||||
Reference in New Issue
Block a user