websocket

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: MIT Imports: 13 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

	// 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) GetDownwardNexusList added in v0.12.0

func (i IncomingSocket) GetDownwardNexusList() []nexusHelper.Nexus

func (*IncomingSocket) InitiateClose

func (i *IncomingSocket) InitiateClose()

func (IncomingSocket) IsEqual added in v0.12.0

func (i IncomingSocket) IsEqual(n nexusHelper.Nexus) bool

func (*IncomingSocket) Name added in v0.12.0

func (i *IncomingSocket) Name() string

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) SetOnBinMessage added in v0.12.0

func (i *IncomingSocket) SetOnBinMessage(messageBinFunc nexusHelper.OnBinMessage)

func (*IncomingSocket) SetOnMessage added in v0.12.0

func (i *IncomingSocket) SetOnMessage(messageFunc nexusHelper.OnMessage)

func (*IncomingSocket) SharedSeed

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

func (IncomingSocket) UUID added in v0.53.0

func (i IncomingSocket) UUID() uuid.UUID

type OutgoingSocket

type OutgoingSocket struct {
	ws_client.WebsocketClientProtocol

	// 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) GetDownwardNexusList added in v0.13.0

func (i *OutgoingSocket) GetDownwardNexusList() []nexusHelper.Nexus

func (*OutgoingSocket) InitiateClose added in v0.13.0

func (i *OutgoingSocket) InitiateClose()

func (*OutgoingSocket) IsEqual added in v0.13.0

func (i *OutgoingSocket) IsEqual(n nexusHelper.Nexus) bool

func (*OutgoingSocket) Name added in v0.13.0

func (i *OutgoingSocket) Name() string

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) SetOnBinMessage added in v0.13.0

func (i *OutgoingSocket) SetOnBinMessage(messageBinFunc nexusHelper.OnBinMessage)

func (*OutgoingSocket) SetOnMessage added in v0.13.0

func (i *OutgoingSocket) SetOnMessage(messageFunc nexusHelper.OnMessage)

func (*OutgoingSocket) SharedSeed

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

func (*OutgoingSocket) UUID added in v0.53.0

func (i *OutgoingSocket) UUID() uuid.UUID

type WebsocketNexus

type WebsocketNexus struct {
	*base.BaseNexus
}

func NewWebsocketNexus

func NewWebsocketNexus(belowNexus nexus.Nexus, layer layer.Layer) *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