Documentation ¶
Index ¶
- Variables
- func EncodePacket(p Packet) (string, error)
- type Client
- func (c *Client) Handle(h Handler)
- func (c *Client) HandleFunc(fn func(p *Packet))
- func (c *Client) HandleMessage(msg string) error
- func (c *Client) NextReqID() int
- func (c *Client) Open() error
- func (c *Client) Send(data []interface{}) error
- func (c *Client) SendAck(data []interface{}) ([]interface{}, error)
- func (c *Client) SendPacket(p Packet) error
- func (c *Client) SendPacketAck(p Packet) ([]interface{}, error)
- type Handler
- type HandlerFunc
- type Packet
- type PacketType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorEmptyPacket = errors.New("packet length should be at least 1 byte") ErrorNullPacket = errors.New("packet length should be at least 1") )
Functions ¶
func EncodePacket ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) HandleFunc ¶
func (*Client) HandleMessage ¶
HandleMessage handles Event.IO Message.
func (*Client) SendPacket ¶
func (*Client) SendPacketAck ¶
type HandlerFunc ¶
type HandlerFunc func(packet *Packet)
func (HandlerFunc) HandleMessage ¶
func (f HandlerFunc) HandleMessage(packet *Packet)
type Packet ¶
type Packet struct { Type PacketType ID *int Data []interface{} }
func DecodePacket ¶
func NewAckPacket ¶
type PacketType ¶
type PacketType int
const ( Connect PacketType = iota Disconnect Event Ack Error BinaryEvent BinaryAck )
func (PacketType) String ¶
func (pt PacketType) String() string
Click to show internal directories.
Click to hide internal directories.