From 480451deb8496b46e44cad4e553e528a34e620bd Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Thu, 6 Jul 2017 16:34:58 +0100 Subject: [PATCH] fixed interface change on sse library and added gitignore --- .gitignore | 1 + notification.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..06b8974 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +monit diff --git a/notification.go b/notification.go index 4e53ca3..b544df0 100644 --- a/notification.go +++ b/notification.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/nats-io/nats" + "github.com/r3labs/sse" ) // Messages holds a collection of the type Message @@ -42,7 +43,6 @@ func (n *Notification) getServiceID() string { func processNotification(notification *Notification, msg *nats.Msg) error { return json.Unmarshal(msg.Data, ¬ification) - } func publishMessage(service string, msg *Message) { @@ -52,6 +52,6 @@ func publishMessage(service string, msg *Message) { log.Println("Could not encode message: ") log.Println(err) } else { - s.Publish(service, data) + s.Publish(service, &sse.Event{Data: data}) } }