Versions in this module Expand all Collapse all v0 v0.0.1 Feb 14, 2020 Changes in this version + const All + const DefaultWebsocketMaxMessageSize + const DefaultWebsocketPingPeriod + const DefaultWebsocketPongTimeout + const DefaultWebsocketReadBufferSize + const DefaultWebsocketWriteTimeout + const DefaultWebsocketWriterBufferSize + const Version + func Random(n int) []byte + func RandomString(n int) string + type Config struct + BinaryMessages bool + CheckOrigin func(req *http.Request) bool + CustomIDFunc ConnectionIDFunc + Error func(res http.ResponseWriter, req *http.Request, status int, reason error) + MaxMessageSize int64 + PingPeriod time.Duration + PongTimeout time.Duration + ReadBufferSize int + WriteBufferSize int + WriteTimeout time.Duration + type Connection struct + func (c *Connection) Disconnect() error + func (c *Connection) Emit(event string, data interface{}) error + func (c *Connection) EmitError(errorMessage string) + func (c *Connection) EmitMessage(nativeMessage []byte) error + func (c *Connection) Get(key string) string + func (c *Connection) ID() string + func (c *Connection) Join(roomName string) + func (c *Connection) Leave(roomName string) + func (c *Connection) List(room string) []string + func (c *Connection) On(event string, cb MessageFunc) + func (c *Connection) OnDisconnect(cb DisconnectFunc) + func (c *Connection) OnError(cb ErrorFunc) + func (c *Connection) OnMessage(cb NativeMessageFunc) + func (c *Connection) Request() *http.Request + func (c *Connection) Set(key string, value string) + func (c *Connection) To(to string) Emmiter + type ConnectionFunc func(*Connection) + type ConnectionIDFunc func(*http.Request) string + type DisconnectFunc func() + type Emmiter interface + Emit func(string, interface{}) error + EmitMessage func([]byte) error + type ErrorFunc (func(string)) + type MessageFunc interface + type NameSpace struct + func (n *NameSpace) List(room string) []string + func (n *NameSpace) To(to string) Emmiter + type NativeMessageFunc func([]byte) + type Rooms map[string][]string + type Server struct + func New(cfg ...Config) *Server + func (s *Server) Connection(cid string) *Connection + func (s *Server) Connections() []string + func (s *Server) Handler() http.Handler + func (s *Server) Of(namespaceName string) *NameSpace + func (s *Server) OnConnection(cb ConnectionFunc) + func (s *Server) Serve() + func (s *Server) Stop() + func (s *Server) ToAll() Emmiter + type UsersRooms map[string][]string