(feature) add LINE notify to notifier

This commit is contained in:
huydx
2017-01-19 16:25:21 +09:00
committed by huydx
parent e1b82e72eb
commit 376d2d56bf
6 changed files with 155 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ type Webhook struct {
Password string
Body string
HttpMethod string
HttpHeader map[string]string
}
var (
@@ -63,6 +64,12 @@ func sendWebRequestSync(ctx context.Context, webhook *Webhook) error {
request.Header.Add("Authorization", util.GetBasicAuthHeader(webhook.User, webhook.Password))
}
if len(webhook.HttpHeader) != 0 {
for k, v := range webhook.HttpHeader {
request.Header.Set(k, v)
}
}
resp, err := ctxhttp.Do(ctx, http.DefaultClient, request)
if err != nil {
return err