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 []byte))
- func (c *Client) HandleUpdate(updateType string, handler func(message json.RawMessage))
- func (c *Client) ID() string
- func (c *Client) InternalUpdates() <-chan []byte
- func (c *Client) ProcessUpdates() (err error)
- func (c *Client) Server() *Socketify
- func (c *Client) SetAttribute(key, val string)
- func (c *Client) SetKeepAliveDuration(keepAlive time.Duration)
- func (c *Client) SetMiddleware(middleware func() error)
- func (c *Client) SetOnClose(onClose func())
- func (c *Client) SetUpdateTypeMiddleware(middleware func(updateType string) error)
- func (c *Client) Updates() chan *Update
- func (c *Client) UpgradeRequest() *http.Request
- func (c *Client) WriteBinaryBytes(data []byte) (err error)
- func (c *Client) WriteRawUpdate(data interface{}) (err error)
- func (c *Client) WriteText(data string) (err error)
- func (c *Client) WriteUpdate(updateType string, data interface{}) (err error)
- 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
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) InternalUpdates ¶ added in v0.2.6
func (*Client) ProcessUpdates ¶
func (*Client) SetAttribute ¶ added in v0.1.7
func (*Client) SetKeepAliveDuration ¶ added in v0.1.10
func (*Client) SetMiddleware ¶ added in v0.2.0
func (*Client) SetOnClose ¶ added in v0.1.9
func (c *Client) SetOnClose(onClose func())
func (*Client) SetUpdateTypeMiddleware ¶ added in v0.2.1
func (*Client) UpgradeRequest ¶ added in v0.1.2
func (*Client) WriteBinaryBytes ¶ added in v0.2.5
func (*Client) WriteRawUpdate ¶ added in v0.1.4
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.