Documentation
¶
Overview ¶
Package lecdn implements LeCDN certificate discovery and in-place CDN deployment.
Index ¶
- type HTTPClient
- type Options
- type Provider
- func (p *Provider) DeployCertificate(ctx context.Context, certificate providers.CertificateMaterial, ...) (providers.DeploymentResult, error)
- func (p *Provider) DiscoverResources(ctx context.Context, deploymentType deployPB.DeploymentType) providers.ResourceCatalogResult
- func (p *Provider) ResolveResource(ctx context.Context, deploymentType deployPB.DeploymentType, targetRef string) (providers.DeploymentResource, error)
- func (p *Provider) TestConnection(ctx context.Context) (bool, error)
- func (p *Provider) TestResource(ctx context.Context, deploymentType deployPB.DeploymentType, targetRef string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
HTTPClient 是 LeCDN provider 使用的最小 HTTP 客户端接口。
type Options ¶
type Options struct {
HTTPClient HTTPClient // HTTPClient 执行 LeCDN 控制面请求。
PollInterval time.Duration // PollInterval 是同步状态轮询间隔。
SyncTimeout time.Duration // SyncTimeout 是单个站点同步等待上限。
}
Options 提供测试可替换的 HTTP 客户端和同步轮询参数。
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider 保存 LeCDN API Token 和控制面访问参数。
func NewWithOptions ¶
NewWithOptions 创建支持注入 HTTP 客户端和轮询参数的 LeCDN provider。
func (*Provider) DeployCertificate ¶
func (p *Provider) DeployCertificate(ctx context.Context, certificate providers.CertificateMaterial, deploymentType deployPB.DeploymentType, resource providers.DeploymentResource) (providers.DeploymentResult, error)
DeployCertificate 原地更新 certificate_id,回读证书后同步全部引用站点。
func (*Provider) DiscoverResources ¶
func (p *Provider) DiscoverResources(ctx context.Context, deploymentType deployPB.DeploymentType) providers.ResourceCatalogResult
DiscoverResources 按 certificate_id 聚合全部已启用的站点域名引用。
func (*Provider) ResolveResource ¶
func (p *Provider) ResolveResource(ctx context.Context, deploymentType deployPB.DeploymentType, targetRef string) (providers.DeploymentResource, error)
ResolveResource 重新发现资源并按不透明 targetRef 唯一解析。
func (*Provider) TestConnection ¶
TestConnection 验证 API Token 可以读取 LeCDN 证书目录。
func (*Provider) TestResource ¶
func (p *Provider) TestResource(ctx context.Context, deploymentType deployPB.DeploymentType, targetRef string) error
TestResource 确认证书引用仍存在且证书详情可读取。
Click to show internal directories.
Click to hide internal directories.