forked from lug/matterbridge
Update of nlopes/slack dependency (#511)
This commit is contained in:
11
vendor/github.com/nlopes/slack/webhooks.go
generated
vendored
11
vendor/github.com/nlopes/slack/webhooks.go
generated
vendored
@@ -1,15 +1,16 @@
|
||||
package slack
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
"net/http"
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type WebhookMessage struct {
|
||||
Text string `json:"text,omitempty"`
|
||||
Attachments []Attachment `json:"attachments,omitempty"`
|
||||
Text string `json:"text,omitempty"`
|
||||
Attachments []Attachment `json:"attachments,omitempty"`
|
||||
}
|
||||
|
||||
func PostWebhook(url string, msg *WebhookMessage) error {
|
||||
@@ -19,7 +20,7 @@ func PostWebhook(url string, msg *WebhookMessage) error {
|
||||
return errors.Wrap(err, "marshal failed")
|
||||
}
|
||||
|
||||
response, err := http.Post(url, "application/json", bytes.NewReader(raw));
|
||||
response, err := http.Post(url, "application/json", bytes.NewReader(raw))
|
||||
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to post webhook")
|
||||
|
||||
Reference in New Issue
Block a user