Documentation
¶
Overview ¶
Package gsocketio is a Socket.IO v4 server for Go, built entirely from the Go standard library — no external dependencies whatsoever.
Index ¶
- func Unmarshal(data json.RawMessage, v interface{}) error
- type AckFunc
- type BinaryAckFunc
- type BinaryEventHandler
- type Conn
- type ConnectHandler
- type DisconnectHandler
- type ErrorHandler
- type EventHandler
- type Options
- type Server
- func (s *Server) ClearRoom(ns, room string)
- func (s *Server) Close() error
- func (s *Server) Count() int
- func (s *Server) ForEachInRoom(ns, room string, fn func(Conn))
- func (s *Server) JoinRoom(ns, room string, c Conn)
- func (s *Server) LeaveAllRooms(ns string, c Conn)
- func (s *Server) LeaveRoom(ns, room string, c Conn)
- func (s *Server) OnBinaryEvent(ns, event string, fn BinaryEventHandler)
- func (s *Server) OnConnect(ns string, fn ConnectHandler)
- func (s *Server) OnDisconnect(ns string, fn DisconnectHandler)
- func (s *Server) OnError(ns string, fn ErrorHandler)
- func (s *Server) OnEvent(ns, event string, fn EventHandler)
- func (s *Server) RoomLen(ns, room string) int
- func (s *Server) RoomMembers(ns, room string) []Conn
- func (s *Server) Rooms(ns string) []string
- func (s *Server) Serve() error
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) ToNamespace(ns, event string, args ...interface{})
- func (s *Server) ToRoom(ns, room, event string, skip Conn, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unmarshal ¶
func Unmarshal(data json.RawMessage, v interface{}) error
Types ¶
type BinaryAckFunc ¶ added in v1.0.3
type BinaryAckFunc = server.BinaryAckFunc
type BinaryEventHandler ¶ added in v1.0.3
type BinaryEventHandler = server.BinaryEventHandler
type ConnectHandler ¶
type ConnectHandler = server.ConnectHandler
type DisconnectHandler ¶
type DisconnectHandler = server.DisconnectHandler
type ErrorHandler ¶
type ErrorHandler = server.ErrorHandler
type EventHandler ¶
type EventHandler = server.EventHandler
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ForEachInRoom ¶
func (*Server) LeaveAllRooms ¶
func (*Server) OnBinaryEvent ¶ added in v1.0.3
func (s *Server) OnBinaryEvent(ns, event string, fn BinaryEventHandler)
func (*Server) OnConnect ¶
func (s *Server) OnConnect(ns string, fn ConnectHandler)
func (*Server) OnDisconnect ¶
func (s *Server) OnDisconnect(ns string, fn DisconnectHandler)
func (*Server) OnError ¶
func (s *Server) OnError(ns string, fn ErrorHandler)
func (*Server) OnEvent ¶
func (s *Server) OnEvent(ns, event string, fn EventHandler)
func (*Server) RoomMembers ¶
func (*Server) ToNamespace ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
basic
command
basic — demonstrates every gsocketio API in one file.
|
basic — demonstrates every gsocketio API in one file. |
|
chat
command
Chat example — a working multi-room chat server using gsocketio.
|
Chat example — a working multi-room chat server using gsocketio. |
|
Package logger provides a levelled logger for gsocketio.
|
Package logger provides a levelled logger for gsocketio. |
|
Package rooms provides thread-safe room management and broadcast primitives.
|
Package rooms provides thread-safe room management and broadcast primitives. |
Click to show internal directories.
Click to hide internal directories.