Added ability to set/add Webhook Token in payload

This commit is contained in:
2024-02-12 16:50:56 +13:00
parent 13e2fa6f7b
commit ddd6326a6e
5 changed files with 27 additions and 26 deletions

View File

@@ -15,6 +15,10 @@ const (
configDelimiter = "@"
)
type Doer interface {
Do(*http.Request) (*http.Response, error)
}
type Notifiers []Notifier
func (n Notifiers) NotifyWithLog(ctx context.Context, notification Notification) error {
@@ -30,11 +34,12 @@ func (n Notifiers) NotifyWithLog(ctx context.Context, notification Notification)
}
type Notification struct {
OldIp net.IP `json:"old_ip,omitempty"`
NewIp net.IP `json:"new_ip"`
CheckedAt time.Time `json:"checked_at"`
ResolverTag string `json:"resolver_tag"`
Domain string `json:"domain"`
OldIp net.IP `json:"old_ip,omitempty"`
NewIp net.IP `json:"new_ip"`
CheckedAt time.Time `json:"checked_at"`
ResolverTag string `json:"resolver_tag"`
Domain string `json:"domain"`
WebhookToken string `json:"token,omitempty"`
}
func (n Notification) ToSlice() []string {

View File

@@ -13,10 +13,6 @@ const (
webhookTag = "webhook"
)
type Doer interface {
Do(*http.Request) (*http.Response, error)
}
type WebhookConfig struct {
Url string
}