client

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFile added in v0.5.2

func DownloadFile(ctx context.Context, httpClient *http.Client, accessKey, downloadURL, filePath string) error

DownloadFile 公共的文件下载函数,可被所有客户端复用

func TestProviderConnection added in v0.5.2

func TestProviderConnection(providerName string) (bool, error)

TestProviderConnection 测试提供商连接

Types

type BusinessExecutor added in v0.5.2

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

BusinessExecutor 业务执行器,封装可复用的业务逻辑

func NewBusinessExecutor added in v0.5.2

func NewBusinessExecutor(downloadFile func(downloadURL, filePath string) error) *BusinessExecutor

NewBusinessExecutor 创建业务执行器

func (*BusinessExecutor) ExecuteBusiness added in v0.5.2

func (be *BusinessExecutor) ExecuteBusiness(providerName string, executeBusinesType deployPB.ExecuteBusinesType, domain, downloadURL, remark, cert, key string) error

ExecuteBusiness 执行业务(根据提供商和业务类型)

func (*BusinessExecutor) ExecuteWithContext added in v0.6.4

func (be *BusinessExecutor) ExecuteWithContext(ctx context.Context, request BusinessRequest) (providers.DeploymentResult, error)

ExecuteWithContext 执行一条支持 context 和结构化结果的业务请求。

type BusinessRequest added in v0.6.4

type BusinessRequest struct {
	ProviderName       string                      // ProviderName 云服务提供商配置名称。
	ExecuteBusinesType deployPB.ExecuteBusinesType // ExecuteBusinesType 明确的执行业务类型。
	TargetRef          string                      // TargetRef 本地配置自动生成的稳定资源引用。
	Domain             string                      // Domain 证书申请或旧部署业务使用的域名。
	DownloadURL        string                      // DownloadURL 本地部署使用的证书下载地址。
	Remark             string                      // Remark 证书中心上传时使用的备注。
	CertificatePEM     string                      // CertificatePEM 资源部署使用的完整证书链。
	PrivateKeyPEM      string                      // PrivateKeyPEM 资源部署使用的私钥。
}

BusinessRequest 描述一次由 WebSocket 下发的业务执行请求。

type ClientInterface added in v0.5.2

type ClientInterface interface {
	GetClientID() string
	GetAccessKey() string
	GetContext() context.Context
	GetHTTPClient() *http.Client
	// contains filtered or unexported methods
}

ClientInterface 客户端接口,用于复用业务逻辑

type ProviderInfo added in v0.5.2

type ProviderInfo struct {
	Name   string
	Remark string
}

ProviderInfo 提供商信息

func GetProviderInfo added in v0.5.2

func GetProviderInfo() []ProviderInfo

GetProviderInfo 获取提供商信息列表

type UpdateHandler added in v0.5.2

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

UpdateHandler 版本更新处理器

func NewUpdateHandler added in v0.5.2

func NewUpdateHandler(ctx context.Context) *UpdateHandler

NewUpdateHandler 创建版本更新处理器

func (*UpdateHandler) HandleUpdate added in v0.5.2

func (uh *UpdateHandler) HandleUpdate()

HandleUpdate 处理版本更新

type WSClient added in v0.5.2

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

func NewWSClient added in v0.5.2

func NewWSClient(ctx context.Context) (*WSClient, error)

NewWSClient 创建新的 WebSocket 客户端

func (*WSClient) Close added in v0.5.2

func (c *WSClient) Close() error

Close 关闭 WebSocket 连接

func (*WSClient) GetAccessKey added in v0.5.2

func (c *WSClient) GetAccessKey() string

GetAccessKey returns the deploy authentication key.

func (*WSClient) GetClientID added in v0.5.2

func (c *WSClient) GetClientID() string

GetClientID returns the unique client identifier.

func (*WSClient) GetServerURL added in v0.5.2

func (c *WSClient) GetServerURL() string

GetServerURL returns the deploy service URL.

func (*WSClient) SetHTTPServer added in v0.5.2

func (c *WSClient) SetHTTPServer(httpServer *server.HTTPServer)

SetHTTPServer configures the local HTTP-01 server dependency.

func (*WSClient) Start added in v0.5.2

func (c *WSClient) Start()

Start starts the WebSocket lifecycle loop once.

func (*WSClient) StartWSNotify added in v0.5.2

func (c *WSClient) StartWSNotify()

StartWSNotify 启动 WebSocket 连接和重连循环

func (*WSClient) Wait added in v0.6.2

func (c *WSClient) Wait(ctx context.Context) error

Wait blocks until the WebSocket lifecycle loop exits or ctx is canceled.

Directories

Path Synopsis
qiniu
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.

Jump to

Keyboard shortcuts

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