Implemented filter for ws + fixes

* proper 0xhex
* filters fixed
* start of filter manager
* accounts for ws. Closes #246
This commit is contained in:
obscuren
2015-01-10 00:51:56 +01:00
parent 491c23a728
commit e3da85faed
10 changed files with 144 additions and 93 deletions

View File

@ -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: