Documentation
¶
Index ¶
- type BayeuxHandler
- type Client
- func (f *Client) Disconnect()
- func (f *Client) HandleMessage(message []byte) error
- func (f *Client) Publish(channel string, data map[string]interface{}) error
- func (f *Client) ReaderDisconnect()
- func (f *Client) SetKeepAliveIntervalSeconds(secs int)
- func (f *Client) Start(ready chan bool) error
- func (f *Client) Subscribe(channel string) error
- func (f *Client) Unsubscribe(channel string) error
- func (f *Client) Write(msg string) error
- type Connection
- type Message
- type Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BayeuxHandler ¶
A BayeuxHandler is responsible for parsing bayeux messages
type Client ¶
type Client struct { Host string MessageChan chan Message // Messages recv'd by the client will be sent to this message channel // contains filtered or unexported fields }
A Client is a connection and a set of subscriptions TODO: remap MessageChan to a set of subscription message channels one per active subscription
func (*Client) Disconnect ¶
func (f *Client) Disconnect()
Disconnect disconnects from the Bayeux server
func (*Client) HandleMessage ¶
HandleMessage parses and interprets a bayeux message response
func (*Client) ReaderDisconnect ¶
func (f *Client) ReaderDisconnect()
ReaderDisconnect is called by the connection handler if the reader connection is dropped by the loss of a server connection
func (*Client) SetKeepAliveIntervalSeconds ¶
SetKeepAliveIntervalSeconds sets the keep alive interval for the client
func (*Client) Subscribe ¶
Subscribe sends a message to the server to subscribe to the given channel
func (*Client) Unsubscribe ¶
Unsubscribe sends a message to the server to unsubscribe from the given channel
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
A Connection is a websocket connnection and state
func NewConnection ¶
func NewConnection(ws *websocket.Conn) *Connection
NewConnection instantiates and returns a new Connection object
func (*Connection) Connected ¶
func (c *Connection) Connected() bool
Connected returns a bool indicating the connection state of both the reader and writer on the connection
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
A Subscription is represents a subscription to a channel by the client Each sub has...
- a messageChan which is recieve any messages sent to it