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 {
// Webhook URL。
WebhookUrl string `json:"webhookUrl"`
// Webhook 回调数据(application/json 或 application/x-www-form-urlencoded 格式)。
WebhookData string `json:"webhookData,omitempty"`
// 请求谓词。
// 零值时默认为 "POST"。
Method string `json:"method,omitempty"`
// 请求标头。
Headers map[string]string `json:"headers,omitempty"`
// 是否允许不安全的连接。
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
}
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)
func (*NotifierProvider) WithLogger ¶ added in v0.3.5
func (n *NotifierProvider) WithLogger(logger *slog.Logger) notifier.Notifier
Click to show internal directories.
Click to hide internal directories.