{"modulePath":"github.com/https-cert/deploy","version":"v0.7.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package onepanel\n\n## Functions\n\n```go\nfunc DeployCertificateTo1PanelWebsite(ctx context.Context, targetRef, certificatePEM, privateKeyPEM string) error\n```\nDeployCertificateTo1PanelWebsite 精确部署 targetRef 对应网站的证书，并回读指纹确认。\n\n```go\nfunc DeployToStore(ctx context.Context, sourceDir, domain string) error\n```\nDeployToStore 上传证书到 1Panel 证书库，保留原有非网站级行为。\n\n```go\nfunc IsOnePanelConfigured() bool\n```\nIsOnePanelConfigured 判断兼容入口是否带有可用的 1Panel 配置。\n\n```go\nfunc IsOnePanelConfiguredWithContext(ctx context.Context) bool\n```\nIsOnePanelConfiguredWithContext 从 context 快照判断 1Panel 是否已配置。\n\n```go\nfunc IsOnePanelErrorRetryable(err error) bool\n```\nIsOnePanelErrorRetryable 判断 1Panel 操作是否适合由后端稍后重试。\n\n```go\nfunc TestOnePanelConnection() error\n```\nTestOnePanelConnection 通过兼容入口验证 1Panel 证书管理权限。\n\n```go\nfunc TestOnePanelConnectionWithContext(ctx context.Context) error\n```\nTestOnePanelConnectionWithContext 使用调用方 context 验证 1Panel 连接。\n\n```go\nfunc TestOnePanelWebsiteConnection(ctx context.Context, targetRef string) error\n```\nTestOnePanelWebsiteConnection 只读确认 targetRef 对应网站仍存在、正在运行且 HTTPS 配置可访问。\n\n## Types\n\n```go\ntype OnePanelAPIResponse struct {\n\tCode    int            `json:\"code\"`    // Code 是 1Panel 业务状态码，200 表示成功。\n\tMessage string         `json:\"message\"` // Message 是仅供 deploy 本地日志使用的诊断信息。\n\tData    jsontext.Value `json:\"data\"`    // Data 是具体接口返回的数据。\n}\n```\nOnePanelAPIResponse 描述 1Panel v2 API 的统一响应外壳。\n\n```go\ntype OnePanelWebsiteResource struct {\n\tTargetRef string   // TargetRef 是客户端生成的不透明稳定引用。\n\tLabel     string   // Label 是网站别名或主域名。\n\tDomain    string   // Domain 是网站主域名。\n\tDomains   []string // Domains 是网站绑定的全部规范化域名。\n\tProtocol  string   // Protocol 是安全展示的当前协议，仅用于判断首次 HTTPS 部署。\n\tStatus    string   // Status 是安全展示的当前运行状态，仅用于阻止停止网站部署。\n}\n```\nOnePanelWebsiteResource 是可以安全上报到 anSSL 后端的脱敏网站资源。\n\n```go\nfunc DiscoverOnePanelWebsiteResources(ctx context.Context) ([]OnePanelWebsiteResource, error)\n```\nDiscoverOnePanelWebsiteResources 动态读取全部 1Panel 网站的脱敏目录。\n\n","path":"github.com/https-cert/deploy/internal/client/deploys/onepanel","name":"onepanel","synopsis":"","isRedistributable":true}
