forked from vikunja/vikunja
Resolve lint errors
This commit is contained in:
parent
d1a301fb3c
commit
c9e67570ea
|
@ -91,7 +91,7 @@ func notifyWebhook(notifiable Notifiable, notification Notification) error {
|
|||
}
|
||||
|
||||
webhookNotification := &WebhookNotification{
|
||||
endpointUrl: config.DatabasePassword.GetString(),
|
||||
endpointURL: config.DatabasePassword.GetString(),
|
||||
headers: map[string]string{}, // TODO: allow passing user-configurable headers
|
||||
body: string(content),
|
||||
}
|
||||
|
|
|
@ -18,18 +18,19 @@ package notifications
|
|||
|
||||
// WebhookNotification represents a notification that published to a http endpoint
|
||||
type WebhookNotification struct {
|
||||
endpointUrl string
|
||||
endpointURL string
|
||||
headers map[string]string
|
||||
body string
|
||||
}
|
||||
|
||||
// SendWebhook sends the notification to the configured endpoint
|
||||
func SendWebhook(w *WebhookNotification) error {
|
||||
_, err := DoPost(w.endpointUrl, w.body, w.headers)
|
||||
// TODO: Have response-code basis exponential retries
|
||||
resp, err := DoPost(w.endpointURL, w.body, w.headers)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
// TODO: Have response-code based checks
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user