diff options
Diffstat (limited to 'websocket/client.go')
-rw-r--r-- | websocket/client.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/websocket/client.go b/websocket/client.go index db2c8e5c9..340a67aea 100644 --- a/websocket/client.go +++ b/websocket/client.go @@ -51,7 +51,13 @@ func (c *Client) Conn() *ws.Conn { } func (c *Client) Write(data interface{}, id int) { - msg := &Message{Id: id, Data: data} + c.write(&Message{Id: id, Data: data}) +} +func (c *Client) Event(data interface{}, ev string, id int) { + c.write(&Message{Id: id, Data: data, Event: ev}) +} + +func (c *Client) write(msg *Message) { select { case c.ch <- msg: default: |