Documentation ¶
Index ¶
- type After
- type Before
- type Client
- func (client *Client) Close() error
- func (client *Client) Connect()
- func (client *Client) Emit(event []byte, body []byte, dataType int, protoType int) error
- func (client *Client) GetRouter() *Router
- func (client *Client) JsonEmit(msg lemo.JsonPackage) error
- func (client *Client) LocalAddr() net.Addr
- func (client *Client) ProtoBufEmit(msg lemo.ProtoBufPackage) error
- func (client *Client) Push(message []byte) error
- func (client *Client) RemoteAddr() net.Addr
- func (client *Client) SetRouter(router *Router) *Client
- func (client *Client) Use(middle ...func(Middle) Middle)
- type Middle
- type RouteHandler
- type Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Name string Host string IP string Port int Conn net.Conn AutoHeartBeat bool HeartBeatTimeout int HeartBeatInterval int HeartBeat func(c *Client) error Reconnect bool ReconnectInterval int ReadBufferSize int WriteBufferSize int HandshakeTimeout int // 消息处理 OnOpen func(c *Client) OnClose func(c *Client) OnMessage func(c *Client, messageType int, msg []byte) OnError func(err exception.Error) Status bool Context lemo.Context PingHandler func(c *Client) func(appData string) error PongHandler func(c *Client) func(appData string) error Protocol tcp.Protocol // contains filtered or unexported fields }
func (*Client) ProtoBufEmit ¶
func (client *Client) ProtoBufEmit(msg lemo.ProtoBufPackage) error
func (*Client) RemoteAddr ¶ added in v1.1.1
type Middle ¶
type Middle func(c *Client, 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
Click to show internal directories.
Click to hide internal directories.