Documentation ¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) Emit(eventName string, data interface{}) error
- func (c *Client) Join(room *Room)
- func (c *Client) Leave(room *Room)
- func (c *Client) Off(eventName string)
- func (c *Client) On(eventName string, listener EventListener)
- func (c *Client) Once(eventName string, listener EventListener)
- type EventListener
- type IgoServer
- func (s *IgoServer) CreateRoom(name string) *Room
- func (s *IgoServer) DeleteRoom(room *Room)
- func (s *IgoServer) Emit(eventName string, data interface{})
- func (s *IgoServer) EmitExcept(client *Client, eventName string, data interface{})
- func (s *IgoServer) GetRoom(name string) *Room
- func (s *IgoServer) Handle() IgoServerHandle
- func (s *IgoServer) OnConnected(listener func(client *Client))
- func (s *IgoServer) OnDisconnected(listener func(client *Client))
- func (s *IgoServer) OnPreConnect(listener func(conn *ws.Conn))
- type IgoServerHandle
- type IgoServerOptions
- type Room
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Id uuid.UUID Events map[string]EventListener Server *IgoServer // contains filtered or unexported fields }
func (*Client) On ¶
func (c *Client) On(eventName string, listener EventListener)
func (*Client) Once ¶
func (c *Client) Once(eventName string, listener EventListener)
type EventListener ¶
type IgoServer ¶
Events: - preconnect: Gets called when the connection is established but the handshake is not yet completed. - connected: Gets called when the connection is established and the handshake is completed. - disconnected: Gets called when the connection is closed.
func CreateIgoServer ¶
func CreateIgoServer(options *IgoServerOptions) *IgoServer
func (*IgoServer) CreateRoom ¶
func (*IgoServer) DeleteRoom ¶
func (*IgoServer) EmitExcept ¶
func (*IgoServer) Handle ¶
func (s *IgoServer) Handle() IgoServerHandle
func (*IgoServer) OnConnected ¶
func (*IgoServer) OnDisconnected ¶
func (*IgoServer) OnPreConnect ¶
type IgoServerHandle ¶
type IgoServerHandle func(w http.ResponseWriter, r *http.Request)
type IgoServerOptions ¶
type Room ¶
type Room struct { Id string // contains filtered or unexported fields }
func (*Room) EmitExcept ¶
func (*Room) OnClientJoined ¶
func (*Room) OnClientLeft ¶
Click to show internal directories.
Click to hide internal directories.