Files
.github
.vscode
docker
internal
app
applicant
certificate
deployer
domain
notify
pkg
core
applicant
deployer
notifier
providers
notifier.go
uploader
logging
utils
vendors
repository
rest
scheduler
statistics
workflow
migrations
ui
.dockerignore
.editorconfig
.gitignore
.goreleaser.yml
CHANGELOG.md
CONTRIBUTING.md
CONTRIBUTING_EN.md
Dockerfile
LICENSE.md
Makefile
README.md
README_EN.md
go.mod
go.sum
main.go
nixpacks.toml
usage.gif
certimate/internal/pkg/core/notifier/notifier.go

29 lines
615 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package notifier
import (
"context"
"log/slog"
)
// 表示定义消息通知器的抽象类型接口。
type Notifier interface {
WithLogger(logger *slog.Logger) Notifier
// 发送通知。
//
// 入参:
// - ctx上下文。
// - subject通知主题。
// - message通知内容。
//
// 出参:
// - res发送结果。
// - err: 错误。
Notify(ctx context.Context, subject string, message string) (res *NotifyResult, err error)
}
// 表示通知发送结果的数据结构。
type NotifyResult struct {
ExtendedData map[string]any `json:"extendedData,omitempty"`
}