Documentation ¶
Index ¶
- type IncomingWebsocketLayer
- type OutgoingWebsocketLayer
- func (o *OutgoingWebsocketLayer) AnnounceNexus(belowNexus nexus.Nexus)
- func (o *OutgoingWebsocketLayer) Connect(location location.WebsocketLocation, seed *beacon.SharedSeed) (*nws.OutgoingSocket, error)
- func (o *OutgoingWebsocketLayer) InitiateCloseAll()
- func (o *OutgoingWebsocketLayer) RegisterAboveLayer(belowLayer layer.Base)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IncomingWebsocketLayer ¶
type IncomingWebsocketLayer struct { layer.BaseLayer Config *config.Config // IncomingSocket is a simulated socket IncomingSocket *websocket.IncomingSocket // WebsocketNexus handles the socket WebsocketNexus *websocket.Nexus }
IncomingWebsocketLayer is handles websockets.
func NewIncomingWebsocketLayer ¶
func NewIncomingWebsocketLayer(config *config.Config) *IncomingWebsocketLayer
NewIncomingWebsocketLayer creates a new incoming websocket layer.
func (*IncomingWebsocketLayer) AnnounceNexus ¶
func (i *IncomingWebsocketLayer) AnnounceNexus(belowNexus nexusHelper.Nexus)
AnnounceNexus creates a new websocket.WebsocketNexus and registers it.
func (*IncomingWebsocketLayer) Listen ¶
func (i *IncomingWebsocketLayer) Listen(wsURL string, tlsInfo *server.TLSInfo) (err error)
Listen listens at a given wsUrl.
func (*IncomingWebsocketLayer) RegisterAboveLayer ¶
func (i *IncomingWebsocketLayer) RegisterAboveLayer(belowLayer layer.Base)
RegisterAboveLayer registers the current nexuses announce/revoke nexuses to the below layer.
func (*IncomingWebsocketLayer) StopListening ¶
func (i *IncomingWebsocketLayer) StopListening()
StopListening stops listening on the incoming websocket layer.
type OutgoingWebsocketLayer ¶
type OutgoingWebsocketLayer struct { layer.BaseLayer NexusBySharedSeed layer.NexusStringMap // OutgoingSocketProtocol OutgoingSocketProtocol *nws.OutgoingSocket }
OutgoingWebsocketLayer processes outgoing websocket connections.
func NewOutgoingWebsocketLayer ¶
func NewOutgoingWebsocketLayer() *OutgoingWebsocketLayer
NewOutgoingWebsocketLayer creates a OutgoingWebsocketLayer.
func (*OutgoingWebsocketLayer) AnnounceNexus ¶
func (o *OutgoingWebsocketLayer) AnnounceNexus(belowNexus nexus.Nexus)
AnnounceNexus creates a new nws.WebsocketNexus and registers it.
func (*OutgoingWebsocketLayer) Connect ¶
func (o *OutgoingWebsocketLayer) Connect(location location.WebsocketLocation, seed *beacon.SharedSeed) (*nws.OutgoingSocket, error)
Connect connects to the outgoing layer.
func (*OutgoingWebsocketLayer) InitiateCloseAll ¶
func (o *OutgoingWebsocketLayer) InitiateCloseAll()
InitiateCloseAll closes all nexuses associated with the layer.
func (*OutgoingWebsocketLayer) RegisterAboveLayer ¶
func (o *OutgoingWebsocketLayer) RegisterAboveLayer(belowLayer layer.Base)
RegisterAboveLayer registers the current nexuses announce/revoke nexuses to the below layer.