Documentation
¶
Index ¶
- Constants
- Variables
- func IsRecordNotFound(err error) bool
- type Access
- type AcmeAccount
- type AliyunAccess
- type ApplyConfig
- type AwsAccess
- type BaiduCloudAccess
- type ByteplusAccess
- type Certificate
- type CertificateIssuer
- type CertificateSubject
- type CertificateValidity
- type ChannelsConfig
- type CloudflareAccess
- type DeployConfig
- func (dc *DeployConfig) GetConfigAsBool(key string) bool
- func (dc *DeployConfig) GetConfigAsInt32(key string) int32
- func (dc *DeployConfig) GetConfigAsString(key string) string
- func (dc *DeployConfig) GetConfigAsVariables() map[string]string
- func (dc *DeployConfig) GetConfigOrDefaultAsBool(key string, defaultValue bool) bool
- func (dc *DeployConfig) GetConfigOrDefaultAsInt32(key string, defaultValue int32) int32
- func (dc *DeployConfig) GetConfigOrDefaultAsString(key string, defaultValue string) string
- func (dc *DeployConfig) GetDomain(wildcard ...bool) string
- type DogeCloudAccess
- type GodaddyAccess
- type HttpreqAccess
- type HuaweiCloudAccess
- type KV
- type KubernetesAccess
- type LocalAccess
- type Meta
- type MetaData
- type NameSiloAccess
- type NotifyMessage
- type NotifyTemplate
- type NotifyTemplates
- type NotifyTestPushReq
- type PdnsAccess
- type QiniuAccess
- type RunLog
- type RunLogOutput
- type RunLogs
- type SSHAccess
- type Setting
- type Statistics
- type TencentAccess
- type VolcEngineAccess
- type WebhookAccess
- type Workflow
- type WorkflowNode
- type WorkflowNodeIo
- type WorkflowNodeIoValueSelector
- type WorkflowOutput
- type WorkflowRunLog
- type WorkflowRunReq
- type XError
Constants ¶
View Source
const ( NotifyChannelEmail = "email" NotifyChannelWebhook = "webhook" NotifyChannelDingtalk = "dingtalk" NotifyChannelLark = "lark" NotifyChannelTelegram = "telegram" NotifyChannelServerChan = "serverchan" NotifyChannelBark = "bark" )
View Source
const ( WorkflowNodeTypeStart = "start" WorkflowNodeTypeEnd = "end" WorkflowNodeTypeApply = "apply" WorkflowNodeTypeDeploy = "deploy" WorkflowNodeTypeNotify = "notify" WorkflowNodeTypeBranch = "branch" WorkflowNodeTypeCondition = "condition" )
View Source
const ( WorkflowTypeAuto = "auto" WorkflowTypeManual = "manual" )
View Source
const WorkflowOutputCertificate = "certificate"
Variables ¶
View Source
var ( ErrInvalidParams = NewXError(400, "invalid params") ErrRecordNotFound = NewXError(404, "record not found") )
View Source
var ValidityDuration = time.Hour * 24 * 10
Functions ¶
func IsRecordNotFound ¶
Types ¶
type Access ¶ added in v0.3.0
type AcmeAccount ¶ added in v0.2.8
type AliyunAccess ¶
type ApplyConfig ¶
type BaiduCloudAccess ¶ added in v0.2.14
type ByteplusAccess ¶ added in v0.2.21
type Certificate ¶ added in v0.3.0
type Certificate struct {
Meta
SAN string `json:"san" db:"san"`
Certificate string `json:"certificate" db:"certificate"`
PrivateKey string `json:"privateKey" db:"privateKey"`
IssuerCertificate string `json:"issuerCertificate" db:"issuerCertificate"`
CertUrl string `json:"certUrl" db:"certUrl"`
CertStableUrl string `json:"certStableUrl" db:"certStableUrl"`
Output string `json:"output" db:"output"`
Workflow string `json:"workflow" db:"workflow"`
ExpireAt time.Time `json:"ExpireAt" db:"expireAt"`
NodeId string `json:"nodeId" db:"nodeId"`
}
type CertificateIssuer ¶
type CertificateSubject ¶
type CertificateSubject struct {
CN string `json:"CN"`
}
type CertificateValidity ¶
type ChannelsConfig ¶
type CloudflareAccess ¶
type CloudflareAccess struct {
DnsApiToken string `json:"dnsApiToken"`
}
type DeployConfig ¶
type DeployConfig struct {
Id string `json:"id"`
Access string `json:"access"`
Type string `json:"type"`
Config map[string]any `json:"config"`
}
func (*DeployConfig) GetConfigAsBool ¶ added in v0.2.7
func (dc *DeployConfig) GetConfigAsBool(key string) bool
以布尔形式获取配置项。
入参:
- key: 配置项的键。
出参:
- 配置项的值。如果配置项不存在或者类型不是布尔,则返回 false。
func (*DeployConfig) GetConfigAsInt32 ¶ added in v0.2.9
func (dc *DeployConfig) GetConfigAsInt32(key string) int32
以 32 位整数形式获取配置项。
入参:
- key: 配置项的键。
出参:
- 配置项的值。如果配置项不存在或者类型不是 32 位整数,则返回 0。
func (*DeployConfig) GetConfigAsString ¶ added in v0.2.7
func (dc *DeployConfig) GetConfigAsString(key string) string
以字符串形式获取配置项。
入参:
- key: 配置项的键。
出参:
- 配置项的值。如果配置项不存在或者类型不是字符串,则返回空字符串。
func (*DeployConfig) GetConfigAsVariables ¶ added in v0.2.13
func (dc *DeployConfig) GetConfigAsVariables() map[string]string
以变量字典形式获取配置项。
出参:
- 变量字典。
func (*DeployConfig) GetConfigOrDefaultAsBool ¶ added in v0.2.7
func (dc *DeployConfig) GetConfigOrDefaultAsBool(key string, defaultValue bool) bool
以布尔形式获取配置项。
入参:
- key: 配置项的键。
- defaultValue: 默认值。
出参:
- 配置项的值。如果配置项不存在或者类型不是布尔,则返回默认值。
func (*DeployConfig) GetConfigOrDefaultAsInt32 ¶ added in v0.2.9
func (dc *DeployConfig) GetConfigOrDefaultAsInt32(key string, defaultValue int32) int32
以 32 位整数形式获取配置项。
入参:
- key: 配置项的键。
- defaultValue: 默认值。
出参:
- 配置项的值。如果配置项不存在、类型不是 32 位整数或者值为零值,则返回默认值。
func (*DeployConfig) GetConfigOrDefaultAsString ¶ added in v0.2.7
func (dc *DeployConfig) GetConfigOrDefaultAsString(key string, defaultValue string) string
以字符串形式获取配置项。
入参:
- key: 配置项的键。
- defaultValue: 默认值。
出参:
- 配置项的值。如果配置项不存在、类型不是字符串或者值为零值,则返回默认值。
func (*DeployConfig) GetDomain ¶ added in v0.2.7
func (dc *DeployConfig) GetDomain(wildcard ...bool) string
GetDomain returns the domain from the deploy config if the domain is a wildcard domain, and wildcard is true, return the wildcard domain
type DogeCloudAccess ¶ added in v0.2.14
type GodaddyAccess ¶
type HttpreqAccess ¶
type HuaweiCloudAccess ¶
type KubernetesAccess ¶
type KubernetesAccess struct {
KubeConfig string `json:"kubeConfig"`
}
type LocalAccess ¶
type LocalAccess struct{}
type MetaData ¶
type MetaData struct {
Version string `json:"version"`
SerialNumber string `json:"serialNumber"`
Validity CertificateValidity `json:"validity"`
SignatureAlgorithm string `json:"signatureAlgorithm"`
Issuer CertificateIssuer `json:"issuer"`
Subject CertificateSubject `json:"subject"`
}
type NameSiloAccess ¶
type NameSiloAccess struct {
ApiKey string `json:"apiKey"`
}
type NotifyMessage ¶
type NotifyTemplate ¶ added in v0.3.0
type NotifyTemplates ¶
type NotifyTemplates struct {
NotifyTemplates []NotifyTemplate `json:"notifyTemplates"`
}
type NotifyTestPushReq ¶
type NotifyTestPushReq struct {
Channel string `json:"channel"`
}
type PdnsAccess ¶
type QiniuAccess ¶
type RunLog ¶
type RunLog struct {
NodeName string `json:"nodeName"`
Error string `json:"error"`
Outputs []RunLogOutput `json:"outputs"`
}
type RunLogOutput ¶
type Setting ¶
type Statistics ¶ added in v0.3.0
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 TencentAccess ¶
type VolcEngineAccess ¶
type VolcEngineAccess struct {
AccessKey string `json:"accessKey"`
SecretKey string `json:"secretKey"`
// Deprecated: Use [AccessKey] and [SecretKey] instead in the future
AccessKeyId string `json:"accessKeyId"`
// Deprecated: Use [AccessKey] and [SecretKey] instead in the future
SecretAccessKey string `json:"secretAccessKey"`
}
type WebhookAccess ¶
type WebhookAccess struct {
Url string `json:"url"`
}
type Workflow ¶ added in v0.3.0
type Workflow struct {
Meta
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"`
Crontab string `json:"crontab"`
Content *WorkflowNode `json:"content"`
Draft *WorkflowNode `json:"draft"`
Enabled bool `json:"enabled"`
HasDraft bool `json:"hasDraft"`
}
type WorkflowNode ¶ added in v0.3.0
type WorkflowNode struct {
Id string `json:"id"`
Name string `json:"name"`
Next *WorkflowNode `json:"next"`
Config map[string]any `json:"config"`
Input []WorkflowNodeIo `json:"input"`
Output []WorkflowNodeIo `json:"output"`
Validated bool `json:"validated"`
Type string `json:"type"`
Branches []WorkflowNode `json:"branches"`
}
func (*WorkflowNode) GetConfigBool ¶
func (n *WorkflowNode) GetConfigBool(key string) bool
func (*WorkflowNode) GetConfigInt64 ¶
func (n *WorkflowNode) GetConfigInt64(key string) int64
func (*WorkflowNode) GetConfigString ¶
func (n *WorkflowNode) GetConfigString(key string) string
type WorkflowNodeIo ¶
type WorkflowOutput ¶ added in v0.3.0
type WorkflowOutput struct {
Meta
Workflow string `json:"workflow"`
NodeId string `json:"nodeId"`
Node *WorkflowNode `json:"node"`
Output []WorkflowNodeIo `json:"output"`
Succeed bool `json:"succeed"`
}
type WorkflowRunLog ¶ added in v0.3.0
type WorkflowRunReq ¶
type WorkflowRunReq struct {
Id string `json:"id"`
}
Click to show internal directories.
Click to hide internal directories.