Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PescaSocket ¶
type PescaSocket struct {
// contains filtered or unexported fields
}
PescaSocket is a wrapper around a classic websocket connection.
func EnhanceSocket ¶
func EnhanceSocket(c *websocket.Conn, channel typings.GeneralChannel) *PescaSocket
EnhanceSocket returns a wrapper around a classic websocket connection.
func (*PescaSocket) Close ¶
func (s *PescaSocket) Close(code int, text string)
Close the socket and send error message to user.
func (*PescaSocket) GetConn ¶
func (s *PescaSocket) GetConn() *websocket.Conn
GetConn returns the current connection.
func (PescaSocket) GetID ¶
func (s PescaSocket) GetID() string
GetID returns the id of this PescaSocket.
func (*PescaSocket) IsLoggedIn ¶
func (s *PescaSocket) IsLoggedIn() bool
IsLoggedIn returns true if the current socket is logged in, false otherwise.
func (*PescaSocket) Send ¶
func (s *PescaSocket) Send(event string, payload interface{})
Send an event + payload message of the websocket.
Click to show internal directories.
Click to hide internal directories.