dogecloud

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: 16 Imported by: 0

Documentation

Overview

Package dogecloud implements DogeCloud certificate upload and 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 是多吉云 provider 使用的最小 HTTP 客户端接口。

type Options

type Options struct {
	HTTPClient HTTPClient // HTTPClient 执行多吉云控制面请求。
	APIBaseURL string     // APIBaseURL 覆盖多吉云默认 API 地址。
}

Options 提供测试可替换的 HTTP 客户端和 API 地址。

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider 保存多吉云 API 密钥和请求客户端。

func New

func New(accessKey, accessSecret string) *Provider

New 创建使用多吉云生产 API 地址的 provider。

func NewWithOptions

func NewWithOptions(accessKey, accessSecret string, options *Options) *Provider

NewWithOptions 创建支持测试注入的多吉云 provider。

func (*Provider) DeployCertificate

func (p *Provider) DeployCertificate(ctx context.Context, certificate providers.CertificateMaterial, deploymentType deployPB.DeploymentType, resource providers.DeploymentResource) (providers.DeploymentResult, error)

DeployCertificate 上传或复用证书,绑定精确域名并回读证书 ID。

func (*Provider) DiscoverResources

func (p *Provider) DiscoverResources(ctx context.Context, deploymentType deployPB.DeploymentType) providers.ResourceCatalogResult

DiscoverResources 实时读取多吉云 CDN 域名目录。

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 验证多吉云密钥可以读取 CDN 域名目录。

func (*Provider) TestResource

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

TestResource 确认多吉云域名仍存在且当前状态可部署。

func (*Provider) UploadCertificate

func (p *Provider) UploadCertificate(ctx context.Context, certificate providers.CertificateMaterial) error

UploadCertificate 将证书上传到多吉云证书中心,并按叶证书指纹复用已有证书。

Jump to

Keyboard shortcuts

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