Documentation
¶
Overview ¶
Package pusher provides a client library for Pusher. It connects to the WebSocket interface, allows subscribing to channels, and receiving events.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug = false
Functions ¶
This section is empty.
Types ¶
type Channel ¶
func (*Channel) Bind ¶
func (self *Channel) Bind(event string, callback EventHandler)
type Client ¶
type Client struct { ClientConfig Connected bool Channels []*Channel UserData Member Debug bool // contains filtered or unexported fields }
Client responsibilities:
* Connecting (via Connection) * Reconnecting on disconnect * Decoding and encoding events * Managing channel subscriptions
func NewWithConfig ¶
func NewWithConfig(c ClientConfig) *Client
NewWithConfig allows creating a new Pusher client which connects to a custom endpoint
func (*Client) BindGlobal ¶
func (*Client) Disconnect ¶
func (self *Client) Disconnect()
func (*Client) Unsubscribe ¶
UnSubscribe unsubscribes the client from the channel
type ClientConfig ¶
type EventHandler ¶
type EventHandler func(data interface{})
Click to show internal directories.
Click to hide internal directories.