ws

package
v0.0.0-...-74afdde Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GlobalHub *hub
)

Functions

func NewReceiveMessage

func NewReceiveMessage(namespace string, clientID int64, body []byte) (*receiveMessage, error)

func NewSendMessage

func NewSendMessage(namespace string, id, clientID, userSubscriptionID int64, typ string, data interface{}) (*sendMessage, error)

Types

type WS

type WS struct {
	Hub *hub
}

func NewWS

func NewWS() *WS

func (*WS) IsConnecting

func (n *WS) IsConnecting(namespace string, clientID int64) bool

func (*WS) MustNotify

func (n *WS) MustNotify(ctx context.Context, namespace string, id, clientID, userID int64, typ string, data interface{}) (interface{}, error)

func (*WS) Notify

func (n *WS) Notify(ctx context.Context, namespace string, id, clientID, userID int64, typ string, data interface{}) (msgID int64, errR error)

func (*WS) Register

func (n *WS) Register(namespace string, id int64, conn *websocket.Conn)

func (*WS) Run

func (n *WS) Run()

func (*WS) ServeWebsocket

func (n *WS) ServeWebsocket(c echo.Context) error

func (*WS) WaitResponse

func (n *WS) WaitResponse(ctx context.Context, msgID int64) (data interface{}, errR error)

Jump to

Keyboard shortcuts

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