Documentation ¶
Overview ¶
Package server @Title handler.go @Description @Author peanut996 @Update peanut996 2021/5/24 16:11
Index ¶
- func NewSIOHandlers() map[string]interface{}
- func ToString(c sio.Conn) string
- type Server
- func (s *Server) AcceptSession(session *Session) error
- func (s *Server) Auth(session *Session) (bool, error)
- func (s *Server) Consume(consumeFunc func(event *api.SingleInvokeRequest))
- func (s *Server) ConsumeEvent(event *api.SingleInvokeRequest)
- func (s *Server) DebugMapVars(c *gin.Context)
- func (s *Server) DisconnectSession(conn sio.Conn) *Session
- func (s *Server) HandleInvoke(c *gin.Context)
- func (s *Server) HandleInvokeEvent(scene, event string, data interface{})
- func (s *Server) Init(cfg *cfgargs.SrvConfig)
- func (s *Server) MountHandlers()
- func (s *Server) OnConnect(f func(sio.Conn) error)
- func (s *Server) OnDisconnect(f func(sio.Conn, string))
- func (s *Server) OnError(f func(sio.Conn, error))
- func (s *Server) Produce(event *api.SingleInvokeRequest)
- func (s *Server) Run(cfg *cfgargs.SrvConfig) error
- func (s *Server) SetNameSpace(nsp string)
- func (s *Server) SocketEventHandler(event string) interface{}
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSIOHandlers ¶
func NewSIOHandlers() map[string]interface{}
Types ¶
type Server ¶
type Server struct { SocketIOToSessions map[string]*Session //UIDSceneToSessions map[string]*Session SceneToSessions map[string][]*Session sync.Mutex // contains filtered or unexported fields }
func (*Server) AcceptSession ¶
AcceptSession authentication for session
func (*Server) Consume ¶
func (s *Server) Consume(consumeFunc func(event *api.SingleInvokeRequest))
func (*Server) ConsumeEvent ¶
func (s *Server) ConsumeEvent(event *api.SingleInvokeRequest)
func (*Server) DebugMapVars ¶
func (*Server) HandleInvoke ¶
func (*Server) HandleInvokeEvent ¶
func (*Server) MountHandlers ¶
func (s *Server) MountHandlers()
func (*Server) Produce ¶
func (s *Server) Produce(event *api.SingleInvokeRequest)
func (*Server) SetNameSpace ¶
SetNameSpace reset namespace
func (*Server) SocketEventHandler ¶
type Session ¶
func NewSession ¶
Click to show internal directories.
Click to hide internal directories.