Documentation
¶
Index ¶
- Constants
- type Client
- func (client *Client) Broadcast(p *Payload) error
- func (client *Client) Close()
- func (client *Client) DialWs() error
- func (client *Client) Emit(event string, p *Payload) error
- func (client *Client) Reconnect() error
- func (client *Client) Recv() error
- func (client *Client) Reply(requestID, cid string, p *Payload) error
- func (client *Client) Request(id string, p *Payload) (<-chan *Received, error)
- func (client *Client) SetMaxMessageSize(limit int64)
- func (client *Client) SetReadDeadline(t time.Duration)
- func (client *Client) Suscribe(events ...string) (<-chan *Received, error)
- type Message
- type MessageType
- type Payload
- type Received
Constants ¶
const MESSAGE_TYPE_BROADCAST = 1
const MESSAGE_TYPE_REPLY = 4
const MESSAGE_TYPE_REQUEST = 3
const MESSAGE_TYPE_STANDARD = 2
const MESSAGE_TYPE_SUSCRIBE = 5
const MESSAGE_TYPE_UNSUSCRIBE = 6
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// The client Id, provided by the server
Id string `json:"Id"`
// channels for receiving messages
RecvBroadcast chan *Received `json:"-"`
RecvRequest chan *Received `json:"-"`
RecvError chan error `json:"-"`
// contains filtered or unexported fields
}
Client is the main eventsocket client
func (*Client) DialWs ¶
DialWs will dial the websocket server, and get a websocket connection in return
func (*Client) SetMaxMessageSize ¶
SetMaxMessageSize sets the max message size. Note: this is not the max frame size
func (*Client) SetReadDeadline ¶
SetReadDeadline sets the deadline to receive a response on the socket
type Message ¶
type Message struct {
MessageType MessageType `json:MessageType`
Event string `json:Event,omitempty`
RequestId string `json:RequestId,omitempty`
// ReplyTo string `json:ReplyTo,omitempty`
ReplyClientId string `json:ReplyClientId,omitempty`
RequestClientId string `json:RequestClientId,omitempty`
Payload *Payload `json:Payload`
}
type MessageType ¶
type MessageType int
Directories
¶
| Path | Synopsis |
|---|---|
|
Godeps
|
|
|
_workspace/src/github.com/gorilla/websocket
Package websocket implements the WebSocket protocol defined in RFC 6455.
|
Package websocket implements the WebSocket protocol defined in RFC 6455. |
|
_workspace/src/github.com/gorilla/websocket/examples/autobahn
command
Command server is a test server for the Autobahn WebSockets Test Suite.
|
Command server is a test server for the Autobahn WebSockets Test Suite. |
|
_workspace/src/github.com/nu7hatch/gouuid
This package provides immutable UUID structs and the functions NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 and 5 UUIDs as specified in RFC 4122.
|
This package provides immutable UUID structs and the functions NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 and 5 UUIDs as specified in RFC 4122. |