Documentation ¶
Index ¶
- Constants
- type IncomingSocket
- func (i IncomingSocket) GetDownwardNexusList() []nexusHelper.Nexus
- func (i *IncomingSocket) InitiateClose()
- func (i IncomingSocket) IsEqual(n nexusHelper.Nexus) bool
- func (i *IncomingSocket) Name() string
- func (i *IncomingSocket) OnBinMessage(belowNexus nexusHelper.Nexus, msg []byte)
- func (i *IncomingSocket) OnClose(wasClean bool, code int, reason string)
- func (i IncomingSocket) OnConnect(r *http.Request)
- func (i IncomingSocket) OnConnecting(r *http.Request)
- func (i *IncomingSocket) OnMessage(belowNexus nexusHelper.Nexus, moneysocketMessage base2.MoneysocketMessage)
- func (i *IncomingSocket) OnOpen()
- func (i *IncomingSocket) OnWsMessage(payload []byte, isBinary bool)
- func (i *IncomingSocket) Send(msg base2.MoneysocketMessage) error
- func (i *IncomingSocket) SendBin(rawMsg []byte) error
- func (i *IncomingSocket) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (i *IncomingSocket) SetOnBinMessage(messageBinFunc nexusHelper.OnBinMessage)
- func (i *IncomingSocket) SetOnMessage(messageFunc nexusHelper.OnMessage)
- func (i *IncomingSocket) SharedSeed() *beacon.SharedSeed
- func (i IncomingSocket) UUID() uuid.UUID
- type Nexus
- type OutgoingSocket
- func (i *OutgoingSocket) GetDownwardNexusList() []nexusHelper.Nexus
- func (i *OutgoingSocket) InitiateClose()
- func (i *OutgoingSocket) IsEqual(n nexusHelper.Nexus) bool
- func (i *OutgoingSocket) Name() string
- func (i *OutgoingSocket) OnBinMessage(belowNexus nexusHelper.Nexus, msg []byte)
- func (i *OutgoingSocket) OnClose(wasClean bool, code int, reason string)
- func (i OutgoingSocket) OnConnect(conn *websocket.Conn, r *http.Response)
- func (i OutgoingSocket) OnConnecting()
- func (i *OutgoingSocket) OnMessage(belowNexus nexusHelper.Nexus, msg moneysocket_message.MoneysocketMessage)
- func (i *OutgoingSocket) OnOpen()
- func (i *OutgoingSocket) OnWsMessage(payload []byte, isBinary bool)
- func (i *OutgoingSocket) Send(msg moneysocket_message.MoneysocketMessage) error
- func (i *OutgoingSocket) SendBin(msg []byte) error
- func (i *OutgoingSocket) SetOnBinMessage(messageBinFunc nexusHelper.OnBinMessage)
- func (i *OutgoingSocket) SetOnMessage(messageFunc nexusHelper.OnMessage)
- func (i *OutgoingSocket) SharedSeed() *beacon.SharedSeed
- func (i *OutgoingSocket) UUID() uuid.UUID
Constants ¶
const IncomingSocketName = "IncomingSocketName"
IncomingSocketName is the name of the incoming socket.
const OutgoingSocketName = "OutgoingSocket"
OutgoingSocketName is the name of the outgoing socket.
const WebsocketNexusName = "WebsocketNexus"
WebsocketNexusName is a websocket nexus.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IncomingSocket ¶
type IncomingSocket struct { server.WebSocketServerProtocol // FactoryMsProtocolLayer protocol layer correspond to the socket interface FactoryMsProtocolLayer layer.Base FactoryMsSharedSeed *beacon.SharedSeed // contains filtered or unexported fields }
IncomingSocket creates a new socket.
func NewIncomingSocket ¶
func NewIncomingSocket() *IncomingSocket
NewIncomingSocket creates a new incoming websocket nexus (accepts request).
func (IncomingSocket) GetDownwardNexusList ¶ added in v0.12.0
func (i IncomingSocket) GetDownwardNexusList() []nexusHelper.Nexus
GetDownwardNexusList gets a nexus list.
func (*IncomingSocket) InitiateClose ¶
func (i *IncomingSocket) InitiateClose()
InitiateClose closes the socket.
func (IncomingSocket) IsEqual ¶ added in v0.12.0
func (i IncomingSocket) IsEqual(n nexusHelper.Nexus) bool
IsEqual is an IncomingSocket handler.
func (*IncomingSocket) Name ¶ added in v0.12.0
func (i *IncomingSocket) Name() string
Name gets the name.
func (*IncomingSocket) OnBinMessage ¶
func (i *IncomingSocket) OnBinMessage(belowNexus nexusHelper.Nexus, msg []byte)
OnBinMessage corresponds to the nexus interface, handles a binary message.
func (*IncomingSocket) OnClose ¶
func (i *IncomingSocket) OnClose(wasClean bool, code int, reason string)
OnClose closes the websocket.
func (IncomingSocket) OnConnect ¶
func (i IncomingSocket) OnConnect(r *http.Request)
OnConnect creates a IncomingSocket client connection.
func (IncomingSocket) OnConnecting ¶
func (i IncomingSocket) OnConnecting(r *http.Request)
OnConnecting starts an IncomingSocket connection.
func (*IncomingSocket) OnMessage ¶
func (i *IncomingSocket) OnMessage(belowNexus nexusHelper.Nexus, moneysocketMessage base2.MoneysocketMessage)
OnMessage corresponds to the nexus interface, handles a message.
func (*IncomingSocket) OnWsMessage ¶
func (i *IncomingSocket) OnWsMessage(payload []byte, isBinary bool)
OnWsMessage processes a websocket message.
func (*IncomingSocket) Send ¶
func (i *IncomingSocket) Send(msg base2.MoneysocketMessage) error
Send sends a message.
func (*IncomingSocket) SendBin ¶
func (i *IncomingSocket) SendBin(rawMsg []byte) error
SendBin sends a binary message.
func (*IncomingSocket) ServeHTTP ¶
func (i *IncomingSocket) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves an http request.
func (*IncomingSocket) SetOnBinMessage ¶ added in v0.12.0
func (i *IncomingSocket) SetOnBinMessage(messageBinFunc nexusHelper.OnBinMessage)
SetOnBinMessage sets the binary message handler for the IncomingSocket.
func (*IncomingSocket) SetOnMessage ¶ added in v0.12.0
func (i *IncomingSocket) SetOnMessage(messageFunc nexusHelper.OnMessage)
SetOnMessage sets the message handler for an IncomingSocket.
func (*IncomingSocket) SharedSeed ¶
func (i *IncomingSocket) SharedSeed() *beacon.SharedSeed
SharedSeed gets the shared seed from the IncomingSocket.
func (IncomingSocket) UUID ¶ added in v0.53.0
func (i IncomingSocket) UUID() uuid.UUID
UUID gets the uuid of the IncomingSocket.
type Nexus ¶ added in v0.54.0
Nexus is a nexus.
func NewWebsocketNexus ¶
NewWebsocketNexus creates a websocket nexus.
func (*Nexus) OnBinMessage ¶ added in v0.54.0
OnBinMessage processes a binary message.
type OutgoingSocket ¶
type OutgoingSocket struct { client.WebsocketClientProtocol // FactoryMsProtocolLayer protocol layer coorespond to the socket interface FactoryMsProtocolLayer layer.Base OutgoingSharedSeed *beacon.SharedSeed // contains filtered or unexported fields }
OutgoingSocket is the outgoing socket.
func NewOutgoingSocket ¶
func NewOutgoingSocket() *OutgoingSocket
NewOutgoingSocket creates a new incoming websocket nexus (accepts request).
func (*OutgoingSocket) GetDownwardNexusList ¶ added in v0.13.0
func (i *OutgoingSocket) GetDownwardNexusList() []nexusHelper.Nexus
nolint
func (*OutgoingSocket) InitiateClose ¶ added in v0.13.0
func (i *OutgoingSocket) InitiateClose()
nolint
func (*OutgoingSocket) IsEqual ¶ added in v0.13.0
func (i *OutgoingSocket) IsEqual(n nexusHelper.Nexus) bool
nolint
func (*OutgoingSocket) OnBinMessage ¶
func (i *OutgoingSocket) OnBinMessage(belowNexus nexusHelper.Nexus, msg []byte)
OnBinMessage corresponds to the nexus interface, handles a binary message.
func (*OutgoingSocket) OnClose ¶
func (i *OutgoingSocket) OnClose(wasClean bool, code int, reason string)
nolint
func (OutgoingSocket) OnConnect ¶
func (i OutgoingSocket) OnConnect(conn *websocket.Conn, r *http.Response)
OnConnect manages a websocket connection.
func (OutgoingSocket) OnConnecting ¶
func (i OutgoingSocket) OnConnecting()
OnConnecting is a connecting websocket event.
func (*OutgoingSocket) OnMessage ¶
func (i *OutgoingSocket) OnMessage(belowNexus nexusHelper.Nexus, msg moneysocket_message.MoneysocketMessage)
OnMessage corresponds to the nexus interface, handles a message.
func (*OutgoingSocket) OnOpen ¶
func (i *OutgoingSocket) OnOpen()
OnOpen opens a websocket connection.
func (*OutgoingSocket) OnWsMessage ¶
func (i *OutgoingSocket) OnWsMessage(payload []byte, isBinary bool)
OnWsMessage processes a websocket message.
func (*OutgoingSocket) Send ¶
func (i *OutgoingSocket) Send(msg moneysocket_message.MoneysocketMessage) error
Send sends a message.
func (*OutgoingSocket) SendBin ¶
func (i *OutgoingSocket) SendBin(msg []byte) error
SendBin sends a binary message.
func (*OutgoingSocket) SetOnBinMessage ¶ added in v0.13.0
func (i *OutgoingSocket) SetOnBinMessage(messageBinFunc nexusHelper.OnBinMessage)
nolint
func (*OutgoingSocket) SetOnMessage ¶ added in v0.13.0
func (i *OutgoingSocket) SetOnMessage(messageFunc nexusHelper.OnMessage)
nolint
func (*OutgoingSocket) SharedSeed ¶
func (i *OutgoingSocket) SharedSeed() *beacon.SharedSeed
SharedSeed gets the shared seed of the outgoing socket.