Documentation
¶
Index ¶
- type Client
- func (c *Client) Connect() error
- func (client *Client) On(message string, f interface{}) (err error)
- func (c *Client) OnDisconnect(handler func(err error, statusCode int))
- func (client *Client) RemoveHandler(message string)
- func (client *Client) Send(event string, data ...interface{}) (string, error)
- func (client *Client) SendCompressed(event string, data ...interface{}) (string, error)
- type ID
- type Options
- type Payload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Ready *bool // contains filtered or unexported fields }
func (*Client) OnDisconnect ¶ added in v0.0.6
func (*Client) RemoveHandler ¶ added in v0.0.2
RemoveHandler
func (*Client) Send ¶
Send method sends message to your Websocket server It can take only take up to 3 arguments first being the event-name your server handler will subscribed to (required) second being the message payload of any type (optional) and third is being an indicator (recommended as bool) showing that this message requires an acknowledgement
type Payload ¶
type Payload struct { // Event name used to identify event handlers Event string `json:"event,omitempty"` // Message payload Data interface{} `json:"data,omitempty"` // Ack is string(event name) that will be sent to server which // an acknowledgment will be published/sent to and the client will // need to get the event name from client.Send method after emitting an // event to server. Ack string `json:"ack,omitempty"` }
Click to show internal directories.
Click to hide internal directories.