Skip to content

Commit

Permalink
fixed interface change on sse library and added gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
purehyperbole committed Jul 6, 2017
1 parent ce6ffa4 commit 480451d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
monit
4 changes: 2 additions & 2 deletions notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strings"

"github.com/nats-io/nats"
"github.com/r3labs/sse"
)

// Messages holds a collection of the type Message
Expand Down Expand Up @@ -42,7 +43,6 @@ func (n *Notification) getServiceID() string {

func processNotification(notification *Notification, msg *nats.Msg) error {
return json.Unmarshal(msg.Data, &notification)

}

func publishMessage(service string, msg *Message) {
Expand All @@ -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})
}
}

0 comments on commit 480451d

Please sign in to comment.