Resolve lint errors
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
Rounak Datta 2022-06-03 19:31:10 +05:30
parent d1a301fb3c
commit c9e67570ea
No known key found for this signature in database
GPG Key ID: A04E86FD28F5A421
2 changed files with 5 additions and 4 deletions

View File

@ -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),
}

View File

@ -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
}