socket

package
v0.0.0-...-b15c3c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2021 License: LGPL-3.0 Imports: 8 Imported by: 0

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) Bind

func (s *PescaSocket) Bind()

Bind all relevant things for PescaSocket.

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.

func (*PescaSocket) Start

func (s *PescaSocket) Start()

Start starts . :))

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL