Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotifierConfig ¶ added in v0.3.0
type NotifierConfig struct {
// SMTP 服务器地址。
SmtpHost string `json:"smtpHost"`
// SMTP 服务器端口。
// 零值时根据是否启用 TLS 决定。
SmtpPort int32 `json:"smtpPort"`
// 是否启用 TLS。
SmtpTLS bool `json:"smtpTLS"`
// 用户名。
Username string `json:"username"`
// 密码。
Password string `json:"password"`
// 发件人邮箱。
SenderAddress string `json:"senderAddress"`
// 收件人邮箱。
ReceiverAddress string `json:"receiverAddress"`
}
type NotifierProvider ¶ added in v0.3.0
type NotifierProvider struct {
// contains filtered or unexported fields
}
func NewNotifier ¶ added in v0.3.0
func NewNotifier(config *NotifierConfig) (*NotifierProvider, error)
func (*NotifierProvider) Notify ¶ added in v0.3.0
func (n *NotifierProvider) Notify(ctx context.Context, subject string, message string) (res *notifier.NotifyResult, err error)
Click to show internal directories.
Click to hide internal directories.