{"modulePath":"github.com/https-cert/deploy","version":"v0.5.4","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package client\n\n## Functions\n\n```go\nfunc DownloadFile(ctx context.Context, httpClient *http.Client, accessKey, downloadURL, filePath string) error\n```\nDownloadFile 公共的文件下载函数，可被所有客户端复用\n\n```go\nfunc TestProviderConnection(providerName string) (bool, error)\n```\nTestProviderConnection 测试提供商连接\n\n## Types\n\n```go\ntype BusinessExecutor struct {\n\t// contains filtered or unexported fields\n}\n```\nBusinessExecutor 业务执行器，封装可复用的业务逻辑\n\n```go\nfunc NewBusinessExecutor(downloadFile func(downloadURL, filePath string) error) *BusinessExecutor\n```\nNewBusinessExecutor 创建业务执行器\n\n```go\nfunc (be *BusinessExecutor) ExecuteBusiness(providerName string, executeBusinesType deployPB.ExecuteBusinesType, domain, downloadURL, remark, cert, key string) error\n```\nExecuteBusiness 执行业务（根据提供商和业务类型）\n\n```go\ntype ClientInterface interface {\n\tGetClientID() string\n\tGetAccessKey() string\n\tGetContext() context.Context\n\tGetHTTPClient() *http.Client\n\t// contains filtered or unexported methods\n}\n```\nClientInterface 客户端接口，用于复用业务逻辑\n\n```go\ntype ProviderInfo struct {\n\tName   string\n\tRemark string\n}\n```\nProviderInfo 提供商信息\n\n```go\nfunc GetProviderInfo() []ProviderInfo\n```\nGetProviderInfo 获取提供商信息列表\n\n```go\ntype UpdateHandler struct {\n\t// contains filtered or unexported fields\n}\n```\nUpdateHandler 版本更新处理器\n\n```go\nfunc NewUpdateHandler(ctx context.Context) *UpdateHandler\n```\nNewUpdateHandler 创建版本更新处理器\n\n```go\nfunc (uh *UpdateHandler) HandleUpdate()\n```\nHandleUpdate 处理版本更新\n\n```go\ntype WSClient struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewWSClient(ctx context.Context) (*WSClient, error)\n```\nNewWSClient 创建新的 WebSocket 客户端\n\n```go\nfunc (c *WSClient) Close() error\n```\nClose 关闭 WebSocket 连接\n\n```go\nfunc (c *WSClient) GetAccessKey() string\n```\n\n```go\nfunc (c *WSClient) GetClientID() string\n```\n\n```go\nfunc (c *WSClient) GetServerURL() string\n```\n\n```go\nfunc (c *WSClient) SetHTTPServer(httpServer *server.HTTPServer)\n```\n\n```go\nfunc (c *WSClient) Start()\n```\n\n```go\nfunc (c *WSClient) StartWSNotify()\n```\nStartWSNotify 启动 WebSocket 连接和重连循环\n\n","path":"github.com/https-cert/deploy/internal/client","name":"client","synopsis":"","isRedistributable":true}
