lecdn

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package lecdn implements LeCDN certificate discovery and in-place CDN deployment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPClient

type HTTPClient interface {
	Do(request *http.Request) (*http.Response, error)
}

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 New

func New(apiBaseURL, apiToken string) *Provider

New 创建使用生产控制面参数的 LeCDN provider。

func NewWithOptions

func NewWithOptions(apiBaseURL, apiToken string, options *Options) *Provider

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

func (p *Provider) TestConnection(ctx context.Context) (bool, error)

TestConnection 验证 API Token 可以读取 LeCDN 证书目录。

func (*Provider) TestResource

func (p *Provider) TestResource(ctx context.Context, deploymentType deployPB.DeploymentType, targetRef string) error

TestResource 确认证书引用仍存在且证书详情可读取。

Jump to

Keyboard shortcuts

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