Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
表示默认的日志记录器类型。
func NewDefaultLogger ¶
func NewDefaultLogger() *DefaultLogger
func (*DefaultLogger) FlushRecords ¶
func (l *DefaultLogger) FlushRecords()
func (*DefaultLogger) GetRecords ¶
func (l *DefaultLogger) GetRecords() []string
func (*DefaultLogger) Logf ¶
func (l *DefaultLogger) Logf(format string, args ...any)
func (*DefaultLogger) Logt ¶
func (l *DefaultLogger) Logt(tag string, data ...any)
type DeployResult ¶
表示证书部署结果的数据结构。
type Deployer ¶
type Deployer interface {
// 部署证书。
//
// 入参:
// - ctx:上下文。
// - certPem:证书 PEM 内容。
// - privkeyPem:私钥 PEM 内容。
//
// 出参:
// - res:部署结果。
// - err: 错误。
Deploy(ctx context.Context, certPem string, privkeyPem string) (res *DeployResult, err error)
}
表示定义证书部署器的抽象类型接口。 注意与 `Uploader` 区分,“部署”通常为“上传”的后置操作。
type Logger ¶
type Logger interface {
// 追加一条日志记录。
// 该方法会将 `data` 以 JSON 序列化后拼接到 `tag` 结尾。
//
// 入参:
// - tag:标签。
// - data:数据。
Logt(tag string, data ...any)
// 追加一条日志记录。
// 该方法会将 `args` 以 `format` 格式化。
//
// 入参:
// - format:格式化字符串。
// - args:格式化参数。
Logf(format string, args ...any)
// 获取所有日志记录。
GetRecords() []string
// 清空所有日志记录。
FlushRecords()
}
表示定义证书部署器的日志记录器的抽象类型接口。
type NilLogger ¶
type NilLogger struct{}
表示空的日志记录器类型。 该日志记录器不会执行任何操作。
func NewNilLogger ¶
func NewNilLogger() *NilLogger
func (*NilLogger) FlushRecords ¶
func (l *NilLogger) FlushRecords()
func (*NilLogger) GetRecords ¶
Click to show internal directories.
Click to hide internal directories.