Documentation ¶
Index ¶
- Constants
- type ClientMessage
- type ClientSubscription
- type Connection
- type FayeClient
- func (f *FayeClient) Disconnect()
- func (f *FayeClient) HandleMessage(message []byte) error
- func (f *FayeClient) Publish(channel string, data map[string]interface{}) error
- func (f *FayeClient) ReaderDisconnect()
- func (f *FayeClient) SetKeepAliveIntervalSeconds(secs int)
- func (f *FayeClient) Start(ready chan bool) error
- func (f *FayeClient) Subscribe(channel string) error
- func (f *FayeClient) Unsubscribe(channel string) error
- func (f *FayeClient) Write(msg string) error
- type FayeHandler
Constants ¶
View Source
const ( StateWSDisconnected = iota // == 0 StateWSConnected = iota StateFayeDisconnected = iota StateFayeConnected = iota )
View Source
const DEFAULT_HOST = "localhost:4001/faye"
View Source
const DEFAULT_KEEP_ALIVE_SECS = 30
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientMessage ¶
type ClientSubscription ¶
type ClientSubscription struct {
// contains filtered or unexported fields
}
==========================================
A subscription represents a subscription to a channel by the client Each sub has a path representing the channel on faye, a messageChan which is recieve any messages sent to it and a connected indicator to indicate the state of the sub on the faye server
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(ws *websocket.Conn) *Connection
func (*Connection) Connected ¶
func (c *Connection) Connected() bool
type FayeClient ¶
type FayeClient struct { Host string MessageChan chan ClientMessage // any messages recv'd by the client will be sent to the message channel - TODO: remap this to a set of subscription message channels one per active subscription // contains filtered or unexported fields }
==========================================
func NewFayeClient ¶
func NewFayeClient(host string) *FayeClient
func (*FayeClient) Disconnect ¶
func (f *FayeClient) Disconnect()
func (*FayeClient) HandleMessage ¶
func (f *FayeClient) HandleMessage(message []byte) error
Parse and interpret a faye message response
func (*FayeClient) Publish ¶
func (f *FayeClient) Publish(channel string, data map[string]interface{}) error
func (*FayeClient) ReaderDisconnect ¶
func (f *FayeClient) ReaderDisconnect()
ReaderDisconnect - called by the connection handler if the reader connection is dropped by the loss of a server connection
func (*FayeClient) SetKeepAliveIntervalSeconds ¶
func (f *FayeClient) SetKeepAliveIntervalSeconds(secs int)
func (*FayeClient) Start ¶
func (f *FayeClient) Start(ready chan bool) error
func (*FayeClient) Subscribe ¶
func (f *FayeClient) Subscribe(channel string) error
func (*FayeClient) Unsubscribe ¶
func (f *FayeClient) Unsubscribe(channel string) error
func (*FayeClient) Write ¶
func (f *FayeClient) Write(msg string) error
Write a message to the faye server over the websocket connection
type FayeHandler ¶
interface responsible for parsing faye messages
Click to show internal directories.
Click to hide internal directories.