Documentation
¶
Index ¶
- func ArgAt[T any](args []any, idx int) (T, error)
- func GetAckFunc(args []any) (func(...any), bool)
- func IO(conn *websocket.Conn, initFn func(s *Socket) error) error
- type Adapter
- type Args
- type Packet
- type Socket
- func (s *Socket) Client() *room.Client[Args]
- func (s *Socket) Connected() bool
- func (s *Socket) Disconnected() bool
- func (s *Socket) Emit(event string, args ...any) error
- func (s *Socket) ID() string
- func (s *Socket) Off(event string, fn func(args ...any)) *Socket
- func (s *Socket) On(event string, fn func(args ...any)) *Socket
- type WebSocketAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAckFunc ¶
Types ¶
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
func (*Socket) Disconnected ¶
type WebSocketAdapter ¶
type WebSocketAdapter struct {
// contains filtered or unexported fields
}
func NewWebSocketAdapter ¶
func NewWebSocketAdapter(conn *websocket.Conn) *WebSocketAdapter
func (*WebSocketAdapter) Close ¶
func (w *WebSocketAdapter) Close() error
func (*WebSocketAdapter) Receive ¶
func (w *WebSocketAdapter) Receive() (Packet, error)
func (*WebSocketAdapter) Send ¶
func (w *WebSocketAdapter) Send(pkt Packet) error
Click to show internal directories.
Click to hide internal directories.