Documentation
¶
Index ¶
- func DownloadFile(ctx context.Context, httpClient *http.Client, ...) error
- func TestDeploymentConnection(providerName string, businessType deployPB.ExecuteBusinesType) (bool, error)
- func TestProviderConnection(providerName string) (bool, error)
- type BusinessExecutor
- type BusinessRequest
- type ClientInterface
- type ProviderInfo
- type UpdateHandler
- type WSClient
- func (c *WSClient) Close() error
- func (c *WSClient) GetAccessKey() string
- func (c *WSClient) GetClientID() string
- func (c *WSClient) GetServerURL() string
- func (c *WSClient) SetHTTPServer(httpServer *server.HTTPServer)
- func (c *WSClient) Start()
- func (c *WSClient) StartWSNotify()
- func (c *WSClient) Wait(ctx context.Context) error
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 TestDeploymentConnection ¶ added in v0.6.5
func TestDeploymentConnection(providerName string, businessType deployPB.ExecuteBusinesType) (bool, error)
TestDeploymentConnection 根据具体部署业务执行对应的连接或环境检查。
func TestProviderConnection ¶ added in v0.5.2
TestProviderConnection 测试云服务 provider 连接,供 CLI doctor 复用。
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 // Name 是客户端配置中的 provider 名称。
Remark string // Remark 是控制台展示的 provider 说明。
}
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
NewWSClient 创建新的 WebSocket 客户端
func (*WSClient) GetAccessKey ¶ added in v0.5.2
GetAccessKey returns the deploy authentication key.
func (*WSClient) GetClientID ¶ added in v0.5.2
GetClientID returns the unique client identifier.
func (*WSClient) GetServerURL ¶ added in v0.5.2
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 连接和重连循环