refactor: abstractions

This commit is contained in:
Fu Diwei
2025-06-15 22:17:49 +08:00
parent 4752c49fed
commit 4ac3618f7e
4 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package core
import (
"context"
)
// 表示定义 SSL 证书部署器的抽象类型接口。
type SSLDeployer interface {
WithLogger
// 部署证书。
//
// 入参:
// - ctx上下文。
// - certPEM证书 PEM 内容。
// - privkeyPEM私钥 PEM 内容。
//
// 出参:
// - res部署结果。
// - err: 错误。
Deploy(ctx context.Context, certPEM string, privkeyPEM string) (_res *SSLDeployResult, _err error)
}
// 表示 SSL 证书部署结果的数据结构。
type SSLDeployResult struct {
ExtendedData map[string]any `json:"extendedData,omitempty"`
}