websocket

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const IncomingSocketName = "IncomingSocketName"
View Source
const OutgoingSocketName = "OutgoingSocket"
View Source
const WebsocketNexusName = "WebsocketNexus"

Variables

This section is empty.

Functions

This section is empty.

Types

type IncomingSocket

type IncomingSocket struct {
	ws_server.WebSocketServerProtocol
	nexusHelper.Nexus

	// protocol layer coorespond to the socket interface
	FactoryMsProtocolLayer layer.Layer
	FactoryMsSharedSeed    *beacon.SharedSeed
	// contains filtered or unexported fields
}

func NewIncomingSocket

func NewIncomingSocket() IncomingSocket

create a new incoming websocket nexus (accepts request)

func (*IncomingSocket) InitiateClose

func (i *IncomingSocket) InitiateClose()

func (*IncomingSocket) OnBinMessage

func (i *IncomingSocket) OnBinMessage(belowNexus nexusHelper.Nexus, msg []byte)

cooresponds to the nexus interface, handles a binary message

func (*IncomingSocket) OnClose

func (i *IncomingSocket) OnClose(wasClean bool, code int, reason string)

func (IncomingSocket) OnConnect

func (i IncomingSocket) OnConnect(r *http.Request)

func (IncomingSocket) OnConnecting

func (i IncomingSocket) OnConnecting(r *http.Request)

func (*IncomingSocket) OnMessage

func (i *IncomingSocket) OnMessage(belowNexus nexusHelper.Nexus, moneysocketMessage base2.MoneysocketMessage)

cooresponds to the nexus interface, handles a message

func (*IncomingSocket) OnOpen

func (i *IncomingSocket) OnOpen()

func (*IncomingSocket) OnWsMessage

func (i *IncomingSocket) OnWsMessage(payload []byte, isBinary bool)

func (*IncomingSocket) Send

func (*IncomingSocket) SendBin

func (i *IncomingSocket) SendBin(rawMsg []byte) error

func (*IncomingSocket) ServeHTTP

func (i *IncomingSocket) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*IncomingSocket) SharedSeed

func (i *IncomingSocket) SharedSeed() *beacon.SharedSeed

type OutgoingSocket

type OutgoingSocket struct {
	ws_client.WebsocketClientProtocol
	nexusHelper.Nexus

	// protocol layer coorespond to the socket interface
	FactoryMsProtocolLayer layer.Layer
	// add an outgoing shared seed modules
	OutgoingSharedSeed *beacon.SharedSeed
	// contains filtered or unexported fields
}

func NewOutgoingSocket

func NewOutgoingSocket() OutgoingSocket

create a new incoming websocket nexus (accepts request)

func (*OutgoingSocket) OnBinMessage

func (i *OutgoingSocket) OnBinMessage(belowNexus nexusHelper.Nexus, msg []byte)

cooresponds to the nexus interface, handles a binary message

func (*OutgoingSocket) OnClose

func (i *OutgoingSocket) OnClose(wasClean bool, code int, reason string)

func (OutgoingSocket) OnConnect

func (i OutgoingSocket) OnConnect(conn *websocket.Conn, r *http.Response)

func (OutgoingSocket) OnConnecting

func (i OutgoingSocket) OnConnecting()

func (*OutgoingSocket) OnMessage

cooresponds to the nexus interface, handles a message

func (*OutgoingSocket) OnOpen

func (i *OutgoingSocket) OnOpen()

func (*OutgoingSocket) OnWsMessage

func (i *OutgoingSocket) OnWsMessage(payload []byte, isBinary bool)

func (*OutgoingSocket) Send

func (*OutgoingSocket) SendBin

func (i *OutgoingSocket) SendBin(msg []byte) error

func (*OutgoingSocket) SharedSeed

func (i *OutgoingSocket) SharedSeed() *beacon.SharedSeed

type WebsocketNexus

type WebsocketNexus struct {
	*base.BaseNexus
}

func NewWebsocketNexus

func NewWebsocketNexus(belowNexus nexus.Nexus) WebsocketNexus

func (*WebsocketNexus) OnBinMessage

func (o *WebsocketNexus) OnBinMessage(belowNexus nexus.Nexus, msgByte []byte)

func (*WebsocketNexus) OnMessage

func (o *WebsocketNexus) OnMessage(belowNexus nexus.Nexus, msg base2.MoneysocketMessage)

Jump to

Keyboard shortcuts

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