Documentation
¶
Index ¶
- type Client
- type Message
- type Server
- func (s *Server) Broadcast(messageType int, message []byte)
- func (s *Server) CallBind(client *Client)
- func (s *Server) CallUnbind(client *Client)
- func (s *Server) GetClientById(id string) (client *Client)
- func (s *Server) PushByIds(messageType int, message []byte, ids ...string)
- func (s *Server) Start(ctx context.Context)
- func (s *Server) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // The clients of *Server. Server *Server // The unique id of the successfully bound business. ClientId string // contains filtered or unexported fields }
Client is a middleman between the websocket connection and the Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server maintains the set of active clients and broadcasts messages to the clients.
func (*Server) CallUnbind ¶
func (*Server) GetClientById ¶
Click to show internal directories.
Click to hide internal directories.