Documentation ¶
Index ¶
- type After
- type Before
- type Middle
- type RouteHandler
- type Router
- type Server
- func (socket *Server) Close(fd uint32) error
- func (socket *Server) Emit(fd uint32, event []byte, body []byte, dataType int, protoType int) exception.Error
- func (socket *Server) EmitAll(event []byte, body []byte, dataType int, protoType int) (int, int)
- func (socket *Server) GetConnection(fd uint32) (*Socket, bool)
- func (socket *Server) GetConnections() chan *Socket
- func (socket *Server) GetConnectionsCount() uint32
- func (socket *Server) GetRouter() *Router
- func (socket *Server) JsonEmit(fd uint32, msg lemo.JsonPackage) exception.Error
- func (socket *Server) JsonEmitAll(msg lemo.JsonPackage) (int, int)
- func (socket *Server) LocalAddr() net.Addr
- func (socket *Server) ProtoBufEmit(fd uint32, msg lemo.ProtoBufPackage) exception.Error
- func (socket *Server) ProtoBufEmitAll(msg lemo.ProtoBufPackage) (int, int)
- func (socket *Server) Push(fd uint32, msg []byte) exception.Error
- func (socket *Server) Ready()
- func (socket *Server) SetRouter(router *Router) *Server
- func (socket *Server) Shutdown()
- func (socket *Server) Start()
- func (socket *Server) Use(middle ...func(Middle) Middle)
- type Socket
- func (conn *Socket) ClientIP() string
- func (conn *Socket) Close() error
- func (conn *Socket) Emit(event []byte, body []byte, dataType int, protoType int) exception.Error
- func (conn *Socket) Host() string
- func (conn *Socket) JsonEmit(msg lemo.JsonPackage) exception.Error
- func (conn *Socket) ProtoBufEmit(msg lemo.ProtoBufPackage) exception.Error
- func (conn *Socket) Push(msg []byte) exception.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middle ¶
type Middle func(conn *Socket, receive *lemo.ReceivePackage)
type RouteHandler ¶
type RouteHandler struct {
// contains filtered or unexported fields
}
func (*RouteHandler) Route ¶
func (handler *RouteHandler) Route(path string) *route
type Router ¶
type Router struct { IgnoreCase bool // contains filtered or unexported fields }
func (*Router) GetAllRouters ¶
func (router *Router) GetAllRouters() []*node
func (*Router) SetGlobalAfter ¶ added in v1.1.1
func (*Router) SetGlobalBefore ¶ added in v1.1.1
type Server ¶
type Server struct { Name string Host string Port int IP string AutoBind bool OnClose func(conn *Socket) OnMessage func(conn *Socket, messageType int, msg []byte) OnOpen func(conn *Socket) OnError func(err exception.Error) OnSuccess func() HeartBeatTimeout int HeartBeatInterval int ReadBufferSize int WriteBufferSize int WaitQueueSize int HandshakeTimeout int PingHandler func(connection *Socket) func(appData string) error PongHandler func(connection *Socket) func(appData string) error Protocol tcp.Protocol // contains filtered or unexported fields }
func (*Server) GetConnections ¶
func (*Server) GetConnectionsCount ¶
func (*Server) JsonEmitAll ¶
func (socket *Server) JsonEmitAll(msg lemo.JsonPackage) (int, int)
func (*Server) ProtoBufEmit ¶
func (*Server) ProtoBufEmitAll ¶
func (socket *Server) ProtoBufEmitAll(msg lemo.ProtoBufPackage) (int, int)
Click to show internal directories.
Click to hide internal directories.