Pass struct along with OnEvent event.

This commit is contained in:
Bruce Marriner 2016-04-11 16:56:43 -05:00
parent 92c27c7712
commit 836e78d3d9
2 changed files with 3 additions and 0 deletions

View file

@ -265,6 +265,7 @@ type Event struct {
Operation int `json:"op"` Operation int `json:"op"`
Direction int `json:"dir"` Direction int `json:"dir"`
RawData json.RawMessage `json:"d"` RawData json.RawMessage `json:"d"`
Struct interface{} `json:"-"`
} }
// A Ready stores all data for the websocket READY event. // A Ready stores all data for the websocket READY event.

View file

@ -301,6 +301,8 @@ func (s *Session) event(messageType int, message []byte) {
if i != nil { if i != nil {
s.handle(i) s.handle(i)
} }
e.Struct = i
s.handle(e) s.handle(e)
return return