Versions in this module Expand all Collapse all v1 v1.0.0 Mar 8, 2022 Changes in this version + type After func(conn *Conn, stream *socket.Stream) error + type Before func(conn *Conn, stream *socket.Stream) error + type Conn struct + Conn *websocket.Conn + FD int64 + LastPing time.Time + Name string + Request *http.Request + Response http.ResponseWriter + Server *Server + func (c *Conn) ClientIP() string + func (c *Conn) Close() error + func (c *Conn) Emit(pack socket.Pack) error + func (c *Conn) Host() string + func (c *Conn) JsonEmit(msg socket.JsonPack) error + func (c *Conn) Ping() error + func (c *Conn) Pong() error + func (c *Conn) ProtoBufEmit(msg socket.ProtoBufPack) error + func (c *Conn) Push(msg []byte) error + func (c *Conn) Write(messageType int, msg []byte) (int, error) + type Middle func(conn *Conn, stream *socket.Stream) + type RouteHandler struct + func (rh *RouteHandler) Remove(path ...string) + func (rh *RouteHandler) Route(path ...string) *route + type Router struct + StrictMode bool + func (r *Router) GetAllRouters() []*node + func (r *Router) Group(path ...string) *group + func (r *Router) Remove(path ...string) + func (r *Router) Route(path ...string) *route + func (r *Router) SetGlobalAfter(after ...After) + func (r *Router) SetGlobalBefore(before ...Before) + type Server struct + Addr string + CertFile string + CheckOrigin func(r *http.Request) bool + HandshakeTimeout time.Duration + HeartBeatInterval time.Duration + HeartBeatTimeout time.Duration + KeyFile string + Name string + OnClose func(conn *Conn) + OnError func(err error) + OnMessage func(conn *Conn, msg []byte) + OnOpen func(conn *Conn) + OnSuccess func() + OnUnknown func(conn *Conn, message []byte, next Middle) + PingHandler func(conn *Conn) func(appData string) error + PongHandler func(conn *Conn) func(appData string) error + Protocol websocket2.Protocol + ReadBufferSize int + WriteBufferSize int + func (s *Server) Close(fd int64) error + func (s *Server) Emit(fd int64, pack socket.Pack) error + func (s *Server) EmitAll(pack socket.Pack) (int, int) + func (s *Server) GetConnection(fd int64) (*Conn, bool) + func (s *Server) GetConnections() chan *Conn + func (s *Server) GetConnectionsCount() int + func (s *Server) GetRouter() *Router + func (s *Server) JsonEmit(fd int64, pack socket.JsonPack) error + func (s *Server) JsonEmitAll(pack socket.JsonPack) (int, int) + func (s *Server) LocalAddr() net.Addr + func (s *Server) ProtoBufEmit(fd int64, pack socket.ProtoBufPack) error + func (s *Server) ProtoBufEmitAll(msg socket.ProtoBufPack) (int, int) + func (s *Server) Push(fd int64, msg []byte) error + func (s *Server) Ready() + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Server) SetRouter(router *Router) *Server + func (s *Server) Shutdown() error + func (s *Server) Start() + func (s *Server) Use(middle ...func(next Middle) Middle) Other modules containing this package github.com/lemoyxk/kitty/v2