events
2015-05-15
Child:e86251b04826
events/event.go
Implement events package. This is the package we'll use to keep all the cross-binary "ping" notification code in sync. We'll use it to define shared types and helper functions. For now, just define the Event type. We'll use this to broadcast "something happened!"
| paddy@0 | 1 package events |
| paddy@0 | 2 |
| paddy@0 | 3 import ( |
| paddy@0 | 4 "time" |
| paddy@0 | 5 ) |
| paddy@0 | 6 |
| paddy@0 | 7 type Event struct { |
| paddy@0 | 8 System string `json:"system"` |
| paddy@0 | 9 Model string `json:"model"` |
| paddy@0 | 10 ID string `json:"id"` |
| paddy@0 | 11 Action string `json:"action"` |
| paddy@0 | 12 Timestamp time.Time `json:"timestamp"` |
| paddy@0 | 13 Data interface{} `json:"data"` |
| paddy@0 | 14 } |