domain

package
v0.3.0-alpha.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CertificateSourceTypeWorkflow = CertificateSourceType("workflow")
	CertificateSourceTypeUpload   = CertificateSourceType("upload")
)
View Source
const (
	NotifyChannelTypeBark       = NotifyChannelType("bark")
	NotifyChannelTypeDingTalk   = NotifyChannelType("dingtalk")
	NotifyChannelTypeEmail      = NotifyChannelType("email")
	NotifyChannelTypeLark       = NotifyChannelType("lark")
	NotifyChannelTypeServerChan = NotifyChannelType("serverchan")
	NotifyChannelTypeTelegram   = NotifyChannelType("telegram")
	NotifyChannelTypeWebhook    = NotifyChannelType("webhook")
	NotifyChannelTypeWeCom      = NotifyChannelType("wecom")
)

消息通知渠道常量值。

注意:如果追加新的常量值,请保持以 ASCII 排序。
NOTICE: If you add new constant, please keep ASCII order.
View Source
const (
	AccessProviderTypeACMEHttpReq  = AccessProviderType("acmehttpreq")
	AccessProviderTypeAliyun       = AccessProviderType("aliyun")
	AccessProviderTypeAWS          = AccessProviderType("aws")
	AccessProviderTypeAzure        = AccessProviderType("azure")
	AccessProviderTypeBaiduCloud   = AccessProviderType("baiducloud")
	AccessProviderTypeBytePlus     = AccessProviderType("byteplus")
	AccessProviderTypeCloudflare   = AccessProviderType("cloudflare")
	AccessProviderTypeDogeCloud    = AccessProviderType("dogecloud")
	AccessProviderTypeEdgio        = AccessProviderType("edgio")
	AccessProviderTypeGoDaddy      = AccessProviderType("godaddy")
	AccessProviderTypeHuaweiCloud  = AccessProviderType("huaweicloud")
	AccessProviderTypeKubernetes   = AccessProviderType("k8s")
	AccessProviderTypeLocal        = AccessProviderType("local")
	AccessProviderTypeNameDotCom   = AccessProviderType("namedotcom")
	AccessProviderTypeNameSilo     = AccessProviderType("namesilo")
	AccessProviderTypeNS1          = AccessProviderType("ns1")
	AccessProviderTypePowerDNS     = AccessProviderType("powerdns")
	AccessProviderTypeQiniu        = AccessProviderType("qiniu")
	AccessProviderTypeSSH          = AccessProviderType("ssh")
	AccessProviderTypeTencentCloud = AccessProviderType("tencentcloud")
	AccessProviderTypeUCloud       = AccessProviderType("ucloud")
	AccessProviderTypeVolcEngine   = AccessProviderType("volcengine")
	AccessProviderTypeWebhook      = AccessProviderType("webhook")
)

授权提供商类型常量值。

注意:如果追加新的常量值,请保持以 ASCII 排序。
NOTICE: If you add new constant, please keep ASCII order.
View Source
const (
	ApplyDNSProviderTypeACMEHttpReq     = ApplyDNSProviderType("acmehttpreq")
	ApplyDNSProviderTypeAliyun          = ApplyDNSProviderType("aliyun") // 兼容旧值,等同于 [ApplyDNSProviderTypeAliyunDNS]
	ApplyDNSProviderTypeAliyunDNS       = ApplyDNSProviderType("aliyun-dns")
	ApplyDNSProviderTypeAWS             = ApplyDNSProviderType("aws") // 兼容旧值,等同于 [ApplyDNSProviderTypeAWSRoute53]
	ApplyDNSProviderTypeAWSRoute53      = ApplyDNSProviderType("aws-route53")
	ApplyDNSProviderTypeAzureDNS        = ApplyDNSProviderType("azure-dns")
	ApplyDNSProviderTypeCloudflare      = ApplyDNSProviderType("cloudflare")
	ApplyDNSProviderTypeGoDaddy         = ApplyDNSProviderType("godaddy")
	ApplyDNSProviderTypeHuaweiCloud     = ApplyDNSProviderType("huaweicloud") // 兼容旧值,等同于 [ApplyDNSProviderTypeHuaweiCloudDNS]
	ApplyDNSProviderTypeHuaweiCloudDNS  = ApplyDNSProviderType("huaweicloud-dns")
	ApplyDNSProviderTypeNameDotCom      = ApplyDNSProviderType("namedotcom")
	ApplyDNSProviderTypeNameSilo        = ApplyDNSProviderType("namesilo")
	ApplyDNSProviderTypeNS1             = ApplyDNSProviderType("ns1")
	ApplyDNSProviderTypePowerDNS        = ApplyDNSProviderType("powerdns")
	ApplyDNSProviderTypeTencentCloud    = ApplyDNSProviderType("tencentcloud") // 兼容旧值,等同于 [ApplyDNSProviderTypeTencentCloudDNS]
	ApplyDNSProviderTypeTencentCloudDNS = ApplyDNSProviderType("tencentcloud-dns")
	ApplyDNSProviderTypeVolcEngine      = ApplyDNSProviderType("volcengine") // 兼容旧值,等同于 [ApplyDNSProviderTypeVolcEngineDNS]
	ApplyDNSProviderTypeVolcEngineDNS   = ApplyDNSProviderType("volcengine-dns")
)

申请证书 DNS 提供商常量值。 短横线前的部分始终等于授权提供商类型。

注意:如果追加新的常量值,请保持以 ASCII 排序。
NOTICE: If you add new constant, please keep ASCII order.
View Source
const (
	DeployProviderTypeAliyunALB         = DeployProviderType("aliyun-alb")
	DeployProviderTypeAliyunCDN         = DeployProviderType("aliyun-cdn")
	DeployProviderTypeAliyunCLB         = DeployProviderType("aliyun-clb")
	DeployProviderTypeAliyunDCDN        = DeployProviderType("aliyun-dcdn")
	DeployProviderTypeAliyunLive        = DeployProviderType("aliyun-live")
	DeployProviderTypeAliyunNLB         = DeployProviderType("aliyun-nlb")
	DeployProviderTypeAliyunOSS         = DeployProviderType("aliyun-oss")
	DeployProviderTypeBaiduCloudCDN     = DeployProviderType("baiducloud-cdn")
	DeployProviderTypeBytePlusCDN       = DeployProviderType("byteplus-cdn")
	DeployProviderTypeDogeCloudCDN      = DeployProviderType("dogecloud-cdn")
	DeployProviderTypeEdgioApplications = DeployProviderType("edgio-applications")
	DeployProviderTypeHuaweiCloudCDN    = DeployProviderType("huaweicloud-cdn")
	DeployProviderTypeHuaweiCloudELB    = DeployProviderType("huaweicloud-elb")
	DeployProviderTypeKubernetesSecret  = 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")
	DeployProviderTypeTencentCloudCSS   = DeployProviderType("tencentcloud-css")
	DeployProviderTypeTencentCloudECDN  = DeployProviderType("tencentcloud-ecdn")
	DeployProviderTypeTencentCloudEO    = DeployProviderType("tencentcloud-eo")
	DeployProviderTypeUCloudUCDN        = DeployProviderType("ucloud-ucdn")
	DeployProviderTypeUCloudUS3         = DeployProviderType("ucloud-us3")
	DeployProviderTypeVolcEngineCDN     = DeployProviderType("volcengine-cdn")
	DeployProviderTypeVolcEngineCLB     = DeployProviderType("volcengine-clb")
	DeployProviderTypeVolcEngineDCDN    = DeployProviderType("volcengine-dcdn")
	DeployProviderTypeVolcEngineLive    = DeployProviderType("volcengine-live")
	DeployProviderTypeVolcEngineTOS     = DeployProviderType("volcengine-tos")
	DeployProviderTypeWebhook           = DeployProviderType("webhook")
)

部署目标提供商常量值。 短横线前的部分始终等于授权提供商类型。

注意:如果追加新的常量值,请保持以 ASCII 排序。
NOTICE: If you add new constant, please keep ASCII order.
View Source
const (
	WorkflowNodeTypeStart     = WorkflowNodeType("start")
	WorkflowNodeTypeEnd       = WorkflowNodeType("end")
	WorkflowNodeTypeApply     = WorkflowNodeType("apply")
	WorkflowNodeTypeDeploy    = WorkflowNodeType("deploy")
	WorkflowNodeTypeNotify    = WorkflowNodeType("notify")
	WorkflowNodeTypeBranch    = WorkflowNodeType("branch")
	WorkflowNodeTypeCondition = WorkflowNodeType("condition")
)
View Source
const (
	WorkflowTriggerTypeAuto   = WorkflowTriggerType("auto")
	WorkflowTriggerTypeManual = WorkflowTriggerType("manual")
)
View Source
const WORKFLOW_OUTPUT_CERTIFICATE = "certificate"

Variables

View Source
var (
	ErrInvalidParams  = NewError(400, "invalid params")
	ErrRecordNotFound = NewError(404, "record not found")
)

Functions

func IsRecordNotFoundError

func IsRecordNotFoundError(err error) bool

Types

type Access

type Access struct {
	Meta
	Name      string     `json:"name" db:"name"`
	Provider  string     `json:"provider" db:"provider"`
	Config    string     `json:"config" db:"config"`
	Usage     string     `json:"usage" db:"usage"`
	DeletedAt *time.Time `json:"deleted" db:"deleted"`
}

func (*Access) UnmarshalConfigToMap

func (a *Access) UnmarshalConfigToMap() (map[string]any, error)

type AccessConfigForACMEHttpReq

type AccessConfigForACMEHttpReq struct {
	Endpoint string `json:"endpoint"`
	Mode     string `json:"mode,omitempty"`
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

type AccessConfigForAWS

type AccessConfigForAWS struct {
	AccessKeyId     string `json:"accessKeyId"`
	SecretAccessKey string `json:"secretAccessKey"`
}

type AccessConfigForAliyun

type AccessConfigForAliyun struct {
	AccessKeyId     string `json:"accessKeyId"`
	AccessKeySecret string `json:"accessKeySecret"`
}

type AccessConfigForAzure

type AccessConfigForAzure struct {
	TenantId     string `json:"tenantId"`
	ClientId     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
	CloudName    string `json:"cloudName,omitempty"`
}

type AccessConfigForBaiduCloud

type AccessConfigForBaiduCloud struct {
	AccessKeyId     string `json:"accessKeyId"`
	SecretAccessKey string `json:"secretAccessKey"`
}

type AccessConfigForBytePlus

type AccessConfigForBytePlus struct {
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
}

type AccessConfigForCloudflare

type AccessConfigForCloudflare struct {
	DnsApiToken string `json:"dnsApiToken"`
}

type AccessConfigForDogeCloud

type AccessConfigForDogeCloud struct {
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
}

type AccessConfigForEdgio

type AccessConfigForEdgio struct {
	ClientId     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
}

type AccessConfigForGoDaddy

type AccessConfigForGoDaddy struct {
	ApiKey    string `json:"apiKey"`
	ApiSecret string `json:"apiSecret"`
}

type AccessConfigForHuaweiCloud

type AccessConfigForHuaweiCloud struct {
	AccessKeyId     string `json:"accessKeyId"`
	SecretAccessKey string `json:"secretAccessKey"`
}

type AccessConfigForKubernetes

type AccessConfigForKubernetes struct {
	KubeConfig string `json:"kubeConfig,omitempty"`
}

type AccessConfigForLocal

type AccessConfigForLocal struct{}

type AccessConfigForNS1

type AccessConfigForNS1 struct {
	ApiKey string `json:"apiKey"`
}

type AccessConfigForNameDotCom

type AccessConfigForNameDotCom struct {
	Username string `json:"username"`
	ApiToken string `json:"apiToken"`
}

type AccessConfigForNameSilo

type AccessConfigForNameSilo struct {
	ApiKey string `json:"apiKey"`
}

type AccessConfigForPowerDNS

type AccessConfigForPowerDNS struct {
	ApiUrl string `json:"apiUrl"`
	ApiKey string `json:"apiKey"`
}

type AccessConfigForQiniu

type AccessConfigForQiniu struct {
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
}

type AccessConfigForSSH

type AccessConfigForSSH struct {
	Host          string `json:"host"`
	Port          int32  `json:"port"`
	Username      string `json:"username"`
	Password      string `json:"password,omitempty"`
	Key           string `json:"key,omitempty"`
	KeyPassphrase string `json:"keyPassphrase,omitempty"`
}

type AccessConfigForTencentCloud

type AccessConfigForTencentCloud struct {
	SecretId  string `json:"secretId"`
	SecretKey string `json:"secretKey"`
}

type AccessConfigForUCloud

type AccessConfigForUCloud struct {
	PrivateKey string `json:"privateKey"`
	PublicKey  string `json:"publicKey"`
	ProjectId  string `json:"projectId,omitempty"`
}

type AccessConfigForVolcEngine

type AccessConfigForVolcEngine struct {
	AccessKeyId     string `json:"accessKeyId"`
	SecretAccessKey string `json:"secretAccessKey"`
}

type AccessConfigForWebhook

type AccessConfigForWebhook struct {
	Url string `json:"url"`
}

type AccessProviderType

type AccessProviderType string

type AcmeAccount added in v0.2.8

type AcmeAccount struct {
	Meta
	CA       string                 `json:"ca" db:"ca"`
	Email    string                 `json:"email" db:"email"`
	Resource *registration.Resource `json:"resource" db:"resource"`
	Key      string                 `json:"key" db:"key"`
}

type ApplyDNSProviderType

type ApplyDNSProviderType string

type Certificate

type Certificate struct {
	Meta
	Source            CertificateSourceType `json:"source" db:"source"`
	SubjectAltNames   string                `json:"subjectAltNames" db:"subjectAltNames"`
	Certificate       string                `json:"certificate" db:"certificate"`
	PrivateKey        string                `json:"privateKey" db:"privateKey"`
	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"`
	WorkflowId        string                `json:"workflowId" db:"workflowId"`
	WorkflowNodeId    string                `json:"workflowNodeId" db:"workflowNodeId"`
	WorkflowOutputId  string                `json:"workflowOutputId" db:"workflowOutputId"`
	DeletedAt         *time.Time            `json:"deleted" db:"deleted"`
}

type CertificateSourceType

type CertificateSourceType string

type DeployProviderType

type DeployProviderType string

type Error

type Error struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

func NewError

func NewError(code int, msg string) *Error

func (*Error) Error

func (e *Error) Error() string

type Meta

type Meta struct {
	Id        string    `json:"id" db:"id"`
	CreatedAt time.Time `json:"created" db:"created"`
	UpdatedAt time.Time `json:"updated" db:"updated"`
}

type NotifyChannelType

type NotifyChannelType string

type NotifyChannelsSettingsContent

type NotifyChannelsSettingsContent map[string]map[string]any

type NotifyTemplate

type NotifyTemplate struct {
	Subject string `json:"subject"`
	Message string `json:"message"`
}

type NotifyTemplatesSettingsContent

type NotifyTemplatesSettingsContent struct {
	NotifyTemplates []NotifyTemplate `json:"notifyTemplates"`
}

type NotifyTestPushReq

type NotifyTestPushReq struct {
	Channel string `json:"channel"`
}

type Settings

type Settings struct {
	Meta
	Name    string `json:"name" db:"name"`
	Content string `json:"content" db:"content"`
}

func (*Settings) GetNotifyChannelConfig

func (s *Settings) GetNotifyChannelConfig(channel string) (map[string]any, error)

type Statistics

type Statistics struct {
	CertificateTotal      int `json:"certificateTotal"`
	CertificateExpireSoon int `json:"certificateExpireSoon"`
	CertificateExpired    int `json:"certificateExpired"`

	WorkflowTotal    int `json:"workflowTotal"`
	WorkflowEnabled  int `json:"workflowEnabled"`
	WorkflowDisabled int `json:"workflowDisabled"`
}

type Workflow

type Workflow struct {
	Meta
	Name          string                `json:"name" db:"name"`
	Description   string                `json:"description" db:"description"`
	Trigger       WorkflowTriggerType   `json:"trigger" db:"trigger"`
	TriggerCron   string                `json:"triggerCron" db:"triggerCron"`
	Enabled       bool                  `json:"enabled" db:"enabled"`
	Content       *WorkflowNode         `json:"content" db:"content"`
	Draft         *WorkflowNode         `json:"draft" db:"draft"`
	HasDraft      bool                  `json:"hasDraft" db:"hasDraft"`
	LastRunId     string                `json:"lastRunId" db:"lastRunId"`
	LastRunStatus WorkflowRunStatusType `json:"lastRunStatus" db:"lastRunStatus"`
	LastRunTime   time.Time             `json:"lastRunTime" db:"lastRunTime"`
}

func (*Workflow) Table

func (w *Workflow) Table() string

type WorkflowNode

type WorkflowNode struct {
	Id   string           `json:"id"`
	Type WorkflowNodeType `json:"type"`
	Name string           `json:"name"`

	Config  map[string]any   `json:"config"`
	Inputs  []WorkflowNodeIO `json:"inputs"`
	Outputs []WorkflowNodeIO `json:"outputs"`

	Next     *WorkflowNode  `json:"next"`
	Branches []WorkflowNode `json:"branches"`

	Validated bool `json:"validated"`
}

func (*WorkflowNode) GetConfigBool

func (n *WorkflowNode) GetConfigBool(key string) bool

func (*WorkflowNode) GetConfigInt32

func (n *WorkflowNode) GetConfigInt32(key string) int32

func (*WorkflowNode) GetConfigInt64

func (n *WorkflowNode) GetConfigInt64(key string) int64

func (*WorkflowNode) GetConfigMap

func (n *WorkflowNode) GetConfigMap(key string) map[string]any

func (*WorkflowNode) GetConfigString

func (n *WorkflowNode) GetConfigString(key string) string

type WorkflowNodeIO

type WorkflowNodeIO struct {
	Label         string                      `json:"label"`
	Name          string                      `json:"name"`
	Type          string                      `json:"type"`
	Required      bool                        `json:"required"`
	Value         any                         `json:"value"`
	ValueSelector WorkflowNodeIOValueSelector `json:"valueSelector"`
}

type WorkflowNodeIOValueSelector

type WorkflowNodeIOValueSelector struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type WorkflowNodeType

type WorkflowNodeType string

type WorkflowOutput

type WorkflowOutput struct {
	Meta
	WorkflowId string           `json:"workflowId" db:"workflow"`
	NodeId     string           `json:"nodeId" db:"nodeId"`
	Node       *WorkflowNode    `json:"node" db:"node"`
	Outputs    []WorkflowNodeIO `json:"outputs" db:"outputs"`
	Succeeded  bool             `json:"succeeded" db:"succeeded"`
}

type WorkflowRun

type WorkflowRun struct {
	Meta
	WorkflowId string                `json:"workflowId" db:"workflowId"`
	Status     WorkflowRunStatusType `json:"status" db:"status"`
	Trigger    WorkflowTriggerType   `json:"trigger" db:"trigger"`
	StartedAt  time.Time             `json:"startedAt" db:"startedAt"`
	EndedAt    time.Time             `json:"endedAt" db:"endedAt"`
	Logs       []WorkflowRunLog      `json:"logs" db:"logs"`
	Error      string                `json:"error" db:"error"`
}

type WorkflowRunLog

type WorkflowRunLog struct {
	NodeId   string                 `json:"nodeId"`
	NodeName string                 `json:"nodeName"`
	Error    string                 `json:"error"`
	Outputs  []WorkflowRunLogOutput `json:"outputs"`
}

type WorkflowRunLogOutput

type WorkflowRunLogOutput struct {
	Time    string `json:"time"`
	Title   string `json:"title"`
	Content string `json:"content"`
	Error   string `json:"error"`
}

type WorkflowRunLogs

type WorkflowRunLogs []WorkflowRunLog

func (WorkflowRunLogs) FirstError

func (r WorkflowRunLogs) FirstError() string

type WorkflowRunReq

type WorkflowRunReq struct {
	WorkflowId string              `json:"workflowId"`
	Trigger    WorkflowTriggerType `json:"trigger"`
}

type WorkflowRunStatusType

type WorkflowRunStatusType string
const (
	WorkflowRunStatusTypePending   WorkflowRunStatusType = "pending"
	WorkflowRunStatusTypeRunning   WorkflowRunStatusType = "running"
	WorkflowRunStatusTypeSucceeded WorkflowRunStatusType = "succeeded"
	WorkflowRunStatusTypeFailed    WorkflowRunStatusType = "failed"
)

type WorkflowTriggerType

type WorkflowTriggerType string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL