Documentation
¶
Index ¶
- func DeploymentErrorInfo(err error) (message string, retryable bool, requestID string)
- func NewDeploymentError(message string, retryable bool, requestID string, cause error) error
- func ValidateCertificateMaterial(certificate CertificateMaterial, targetDomain string, now time.Time) error
- type CertificateMaterial
- type CertificateUploader
- type ConnectionTester
- type DeploymentError
- type DeploymentResource
- type DeploymentResourceDeployer
- type DeploymentResult
- type ProviderHandler
- type RequestOptions
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeploymentErrorInfo ¶ added in v0.6.4
DeploymentErrorInfo 从任意错误中提取可返回后端的结构化信息。
func NewDeploymentError ¶ added in v0.6.4
NewDeploymentError 创建一个带重试属性的云部署错误。
func ValidateCertificateMaterial ¶ added in v0.6.4
func ValidateCertificateMaterial(certificate CertificateMaterial, targetDomain string, now time.Time) error
ValidateCertificateMaterial 校验证书有效期、域名覆盖关系和证书私钥匹配关系。
Types ¶
type CertificateMaterial ¶ added in v0.6.4
type CertificateMaterial struct {
Name string // Name 云厂商证书备注或别名。
Domain string // Domain 证书申请主域名,仅用于展示和兼容旧业务。
CertificatePEM string // CertificatePEM 完整 PEM 证书链。
PrivateKeyPEM string // PrivateKeyPEM PEM 私钥。
}
CertificateMaterial 封装云部署使用的证书材料。
type CertificateUploader ¶ added in v0.6.4
CertificateUploader 将证书上传到云厂商证书中心。
type ConnectionTester ¶ added in v0.6.4
ConnectionTester 测试云厂商凭据是否可以访问对应控制面。
type DeploymentError ¶ added in v0.6.4
type DeploymentError struct {
Message string // Message 可安全返回后端的脱敏错误说明。
Retryable bool // Retryable 表示后端是否可以自动重试。
RequestID string // RequestID 云厂商请求 ID。
Cause error // Cause 原始错误,仅用于本地错误链和日志。
}
DeploymentError 描述云资源部署失败的重试属性和云厂商请求编号。
func (*DeploymentError) Error ¶ added in v0.6.4
func (e *DeploymentError) Error() string
Error 返回脱敏错误说明。
func (*DeploymentError) Unwrap ¶ added in v0.6.4
func (e *DeploymentError) Unwrap() error
Unwrap 返回原始错误,供 errors.Is 和 errors.As 使用。
type DeploymentResource ¶ added in v0.6.4
type DeploymentResource struct {
TargetRef string // TargetRef 客户端根据资源身份自动生成的不透明稳定引用。
Label string // Label 本地展示名称。
Domain string // Domain 实际绑定证书的域名。
Region string // Region 对象存储地域。
Endpoint string // Endpoint OSS endpoint 覆盖值。
Bucket string // Bucket 对象存储 Bucket。
SiteID string // SiteID 阿里云 ESA Site ID。
ZoneID string // ZoneID 腾讯云 EdgeOne Zone ID。
}
DeploymentResource 描述从明确业务配置中精确解析出的部署资源。
type DeploymentResourceDeployer ¶ added in v0.6.4
type DeploymentResourceDeployer interface {
DeployCertificate(ctx context.Context, certificate CertificateMaterial, business deployPB.ExecuteBusinesType, resource DeploymentResource) (DeploymentResult, error)
}
DeploymentResourceDeployer 将证书部署到一个明确业务下已经精确解析的资源。
type DeploymentResult ¶ added in v0.6.4
type DeploymentResult struct {
RequestID string // RequestID 云厂商请求 ID。
Message string // Message 不包含凭据或敏感资源定位参数的结果说明。
}
DeploymentResult 描述云 API 接受部署后的脱敏诊断信息。
type ProviderHandler ¶
type ProviderHandler interface {
ConnectionTester
CertificateUploader
}
ProviderHandler 组合证书中心上传业务所需的连接测试和证书上传能力。
type RequestOptions ¶
type RequestOptions struct {
Method string // HTTP 请求方法
Path string // API 路径 (例如: "/v1/resource")
Query map[string]string // URL 查询参数
Body any // 请求体 (将被 JSON 编码)
Headers map[string]string // 自定义请求头
Timeout time.Duration // 请求超时时间 (默认: 30s)
BaseURL string // 覆盖默认 Base URL
}
RequestOptions HTTP 请求配置选项
Directories
¶
| Path | Synopsis |
|---|---|
|
Package qiniu implements certificate upload and exact-domain certificate deployment for Qiniu CDN products.
|
Package qiniu implements certificate upload and exact-domain certificate deployment for Qiniu CDN products. |
Click to show internal directories.
Click to hide internal directories.