transport

package
v0.0.0-...-12a54d8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeLongPoll

func MakeLongPoll(msgs interface{}, server Server, w http.ResponseWriter)

func WebsocketServer

func WebsocketServer(m Server) func(*websocket.Conn)

Types

type LongPollingConnection

type LongPollingConnection struct {
	Closed *atomic.Bool
	// contains filtered or unexported fields
}

func NewLongPollingConnection

func NewLongPollingConnection() *LongPollingConnection

func (*LongPollingConnection) Close

func (lp *LongPollingConnection) Close()

func (*LongPollingConnection) IsConnected

func (lp *LongPollingConnection) IsConnected() bool

func (*LongPollingConnection) IsSingleShot

func (lp *LongPollingConnection) IsSingleShot() bool

func (*LongPollingConnection) Send

func (lp *LongPollingConnection) Send(msgs []protocol.Message) error

func (*LongPollingConnection) SendJsonp

func (lp *LongPollingConnection) SendJsonp(msgs []protocol.Message, jsonp string) error

type Server

type Server interface {
	HandleRequest(interface{}, protocol.Connection)
	Logger() utils.Logger
}

type WebSocketConnection

type WebSocketConnection struct {
	// contains filtered or unexported fields
}

func (*WebSocketConnection) Close

func (wc *WebSocketConnection) Close()

func (*WebSocketConnection) IsConnected

func (wc *WebSocketConnection) IsConnected() bool

func (*WebSocketConnection) IsSingleShot

func (wc *WebSocketConnection) IsSingleShot() bool

func (*WebSocketConnection) Send

func (wc *WebSocketConnection) Send(msgs []protocol.Message) error

func (*WebSocketConnection) SendJsonp

func (wc *WebSocketConnection) SendJsonp(msgs []protocol.Message, _ string) error

Jump to

Keyboard shortcuts

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