Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Ack(ctx context.Context, method string, args interface{}, ret interface{}) error
- func (c *Client) Close()
- func (c *Client) Emit(method string, args ...interface{}) error
- func (c *Client) ID() string
- func (c *Client) Listeners() (list []string)
- func (c *Client) Of(namespace string) (*Namespace, error)
- func (c *Client) Off(method string)
- func (c *Client) On(method string, f interface{}) error
- func (c *Client) Run()
- type ErrorArgument
- type ErrorInvalidInterface
- type ErrorNotFunction
- type Handler
- type Header
- type Namespace
- func (n *Namespace) Ack(ctx context.Context, method string, args interface{}, v interface{}) error
- func (n *Namespace) Emit(method string, args ...interface{}) error
- func (n *Namespace) Listeners() (list []string)
- func (n *Namespace) Off(method string)
- func (n *Namespace) On(method string, f interface{}) error
- func (n *Namespace) Ready() <-chan struct{}
Constants ¶
const ( // OnConnection for "connection" messages. OnConnection = protocol.OnConnection // OnDisconnect for "disconnect" messages. OnDisconnect = protocol.OnDisconnect // OnError for "error" messages. OnError = protocol.OnError )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client to handle socket.io connections
func ConnectSync ¶
Connect dials and waits for the "connection" event. It blocks for the timeout duration. If the connection is not established in time, it closes the connection and returns an error.
func DialOnly ¶
DialOnly connects to the host and initializes the socket.io protocol. It doesn't wait for socket.io connection handshake. You probably want to use Connect instead. Only exposed for debugging.
type ErrorArgument ¶
type ErrorArgument struct {
// contains filtered or unexported fields
}
ErrorArgument is used when trying to create a non-function listener with an invalid parameter
func (ErrorArgument) Error ¶
func (e ErrorArgument) Error() string
type ErrorInvalidInterface ¶
type ErrorInvalidInterface struct {
// contains filtered or unexported fields
}
func (ErrorInvalidInterface) Error ¶
func (e ErrorInvalidInterface) Error() string
func (ErrorInvalidInterface) Method ¶
func (e ErrorInvalidInterface) Method() string
type ErrorNotFunction ¶
type ErrorNotFunction struct {
// contains filtered or unexported fields
}
ErrorNotFunction is used when trying to create a non-function listener
func (ErrorNotFunction) Error ¶
func (e ErrorNotFunction) Error() string
type Handler ¶
type Handler struct { Func reflect.Value Out bool Variadic bool // contains filtered or unexported fields }
Handler for the message
func NewHandler ¶
NewHandler creates a new listener
type Header ¶
type Header struct { Sid string `json:"sid"` Upgrades []string `json:"upgrades"` PingInterval int `json:"pingInterval"` PingTimeout int `json:"pingTimeout"` }
Header of engine.io to send and receive packets
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace for the connection.
func NewNamespace ¶
NewNamespace creates a namespace.