events

Paddy 2015-07-15 Parent:e86251b04826

3:ce1212549d47 Go to Latest

events/event.go

Create Publisher interface and stdout publisher. Create a Publisher interface that allows us to use different implementations and switch between them easily. The NSQ publisher already implements the interface, so it was really just copying that. Create an implmentation of the Publisher interface that just logs the data to stdout.

History
     1.1 --- a/event.go	Tue Jul 14 00:05:45 2015 -0400
     1.2 +++ b/event.go	Wed Jul 15 00:19:41 2015 -0400
     1.3 @@ -18,3 +18,7 @@
     1.4  	Timestamp time.Time   `json:"timestamp"`
     1.5  	Data      interface{} `json:"data,omitempty"`
     1.6  }
     1.7 +
     1.8 +type Publisher interface {
     1.9 +	Publish(topic string, event Event) error
    1.10 +}