onepanel

package
v0.4.25 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 部署目标:替换指定网站的证书。
	DEPLOY_TARGET_WEBSITE = "website"
	// 部署目标:替换指定证书。
	DEPLOY_TARGET_CERTIFICATE = "certificate"
)
View Source
const (
	// 匹配模式:指定 ID。
	WEBSITE_MATCH_PATTERN_SPECIFIED = "specified"
	// 匹配模式:证书 SAN 匹配。
	WEBSITE_MATCH_PATTERN_CERTSAN = "certsan"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeployResult added in v0.4.25

type DeployResult = core.DeployerDeployResult

type Deployer

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

func NewDeployer

func NewDeployer(config *DeployerConfig) (*Deployer, error)

func (*Deployer) Deploy

func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*DeployResult, error)

func (*Deployer) SetLogger

func (d *Deployer) SetLogger(logger *slog.Logger)

type DeployerConfig

type DeployerConfig struct {
	// 1Panel 服务地址。
	ServerUrl string `json:"serverUrl"`
	// 1Panel 版本。
	// 可取值 "v1"、"v2"。
	ApiVersion string `json:"apiVersion"`
	// 1Panel 接口密钥。
	ApiKey string `json:"apiKey"`
	// 是否允许不安全的连接。
	AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
	// 子节点名称。
	// 选填。
	NodeName string `json:"nodeName,omitempty"`
	// 部署目标。
	DeployTarget string `json:"deployTarget"`
	// 域名匹配模式。
	// 零值时默认值 [WEBSITE_MATCH_PATTERN_SPECIFIED]。
	WebsiteMatchPattern string `json:"websiteMatchPattern,omitempty"`
	// 网站 ID。
	// 部署目标为 [DEPLOY_TARGET_WEBSITE]、且匹配模式非 [WEBSITE_MATCH_PATTERN_CERTSAN] 时必填。
	WebsiteId int64 `json:"websiteId,omitempty"`
	// 证书 ID。
	// 部署目标为 [DEPLOY_TARGET_CERTIFICATE] 时必填。
	CertificateId int64 `json:"certificateId,omitempty"`
}

type Provider added in v0.4.25

type Provider = core.Deployer

Jump to

Keyboard shortcuts

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