Skip to content

Commit 617a7a7

Browse files
committed
changes to go Module dependency management + minor changes
1 parent 67f2f17 commit 617a7a7

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

Gopkg.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- Based on https://github.com/atomatt/go-xmpp
44

55
## Status
6-
`xmpp-webhook` currently only provides a hook for Grafana. ~~I will implement a `parserFunc` for Prometheus ASAP~~. Check https://github.com/opthomas-prime/xmpp-webhook/blob/master/handler.go to learn how to support more source services.
6+
`xmpp-webhook` ~~currently~~ only provides a hook for Grafana. ~~I will implement a `parserFunc` for Prometheus ASAP~~. Check https://github.com/opthomas-prime/xmpp-webhook/blob/master/handler.go to learn how to support more source services.
77

88
## Usage
99
- `xmpp-webhook` is configured via environment variables:
@@ -13,7 +13,7 @@
1313
- After startup, `xmpp-webhook` tries to connect to the XMPP server and provides the implemented HTTP enpoints (on `:4321`). e.g.:
1414

1515
```
16-
curl -X POST -d @grafana-alert.json localhost:4321/grafana
16+
curl -X POST -d @grafana-webhook-alert-example.json localhost:4321/grafana
1717
```
1818
- After parsing the body in the appropriate `parserFunc`, the notification is then distributed to the configured receivers.
1919

@@ -40,10 +40,9 @@ systemctl start xmpp-webhook
4040
```
4141

4242
## Building
43-
- Get the sources: `go get -u github.com/opthomas-prime/xmpp-webhook`
44-
- Install `dep`: https://github.com/golang/dep
45-
- Change in the project folder: `cd $GOPATH/src/github.com/opthomas-prime/xmpp-webhook`
46-
- Populate `vendor` folder: `dep ensure`
43+
- Dependencies are managed via Go Modules (https://github.com/golang/go/wiki/Modules).
44+
- Clone the sources
45+
- Change in the project folder:
4746
- Build `xmpp-webhook`: `go build`
4847

4948
## Need help?

handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ func grafanaParserFunc(r *http.Request) (string, error) {
6262
var message string
6363
switch alert.State {
6464
case "ok":
65-
message = "8-) " + alert.Title
65+
message = ":) " + alert.Title
6666
default:
67-
message = ":'-( " + alert.Title + "\n" + alert.Message + "\n" + alert.RuleURL
67+
message = ":( " + alert.Title + "\n" + alert.Message + "\n" + alert.RuleURL
6868
}
6969

7070
return message, nil

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func main() {
8585
xc.Out <- xmpp.Message{
8686
To: r,
8787
Body: []xmpp.MessageBody{
88-
xmpp.MessageBody{
88+
{
8989
Value: m,
9090
},
9191
},

0 commit comments

Comments
 (0)