Documentation ¶
Index ¶
- func Options() *options
- type Client
- func (c *Client) Close() error
- func (c *Client) CloseChannel() chan bool
- func (c *Client) GetAttribute(key string) (val string, exists bool)
- func (c *Client) HandleRawUpdate(handler func(message json.RawMessage))
- func (c *Client) HandleUpdate(updateType string, handler func(message json.RawMessage))
- func (c *Client) ID() string
- func (c *Client) ProcessUpdates() (err error)
- func (c *Client) Server() *Socketify
- func (c *Client) SetAttribute(key, val string)
- func (c *Client) Updates() chan *Update
- func (c *Client) UpgradeRequest() *http.Request
- func (c *Client) WriteRawUpdate(data interface{})
- func (c *Client) WriteUpdate(updateType string, data interface{})
- type Logger
- type Socketify
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CloseChannel ¶
func (*Client) GetAttribute ¶ added in v0.1.7
func (*Client) HandleRawUpdate ¶ added in v0.1.3
func (c *Client) HandleRawUpdate(handler func(message json.RawMessage))
HandleRawUpdate registers a default handler for update Note: Add a raw handler if you don't want to follow the API convention {"type": "", "data": {}}
func (*Client) HandleUpdate ¶
func (c *Client) HandleUpdate(updateType string, handler func(message json.RawMessage))
HandleUpdate registers a default handler for updateType Care: If you use this method for an updateType, you won't receive the respected update in your listener
func (*Client) ProcessUpdates ¶
func (*Client) SetAttribute ¶ added in v0.1.7
func (*Client) UpgradeRequest ¶ added in v0.1.2
func (*Client) WriteRawUpdate ¶ added in v0.1.4
func (c *Client) WriteRawUpdate(data interface{})
func (*Client) WriteUpdate ¶
type Update ¶
type Update struct { Type string `json:"type"` Data json.RawMessage `json:"data,omitempty"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.