adapters

package
v0.0.0-...-c5c3ef8 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ErrorCodeClosed = 1

Variables

View Source
var ErrDataPayloadTooLarge = errors.New("data payload too large")

Functions

This section is empty.

Types

type MessageHandler

type MessageHandler = func(message []byte) bool

type SocketAdapter

type SocketAdapter interface {
	Close() error

	// Boolean indicating whether the error was unexpected (true) or not (false)
	Serve() (bool, error)

	WaitReady()
	Name() string

	SetFeaturesContainer(ct features.Container)

	WriteControlMessage(message []byte) error
	SetControlMessageHandler(handler MessageHandler)

	WriteDataMessage(message []byte) error
	SetDataMessageHandler(handler MessageHandler)

	WritePingMessage() error
	SetPongHandler(handler func())

	GetTLSConnectionState() (tls.ConnectionState, bool)

	GetCommandSerializationType() commands.SerializationType

	RemoteAddr() net.Addr
	LocalAddr() net.Addr

	IsServer() bool
	IsClient() bool

	MaxDataPayloadLen() uint16

	RefreshFeatures()
}

type StreamMessageType

type StreamMessageType = byte

type WebSocketAdapter

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

func NewWebSocketAdapter

func NewWebSocketAdapter(conn net.Conn, serializationType commands.SerializationType, isServer bool, initial *bufio.Reader) *WebSocketAdapter

func (*WebSocketAdapter) Close

func (s *WebSocketAdapter) Close() error

func (*WebSocketAdapter) GetCommandSerializationType

func (s *WebSocketAdapter) GetCommandSerializationType() commands.SerializationType

func (*WebSocketAdapter) GetTLSConnectionState

func (s *WebSocketAdapter) GetTLSConnectionState() (tls.ConnectionState, bool)

func (*WebSocketAdapter) IsClient

func (s *WebSocketAdapter) IsClient() bool

func (*WebSocketAdapter) IsServer

func (s *WebSocketAdapter) IsServer() bool

func (*WebSocketAdapter) LocalAddr

func (s *WebSocketAdapter) LocalAddr() net.Addr

func (*WebSocketAdapter) MaxDataPayloadLen

func (s *WebSocketAdapter) MaxDataPayloadLen() uint16

func (*WebSocketAdapter) Name

func (s *WebSocketAdapter) Name() string

func (*WebSocketAdapter) RefreshFeatures

func (s *WebSocketAdapter) RefreshFeatures()

func (*WebSocketAdapter) RemoteAddr

func (s *WebSocketAdapter) RemoteAddr() net.Addr

func (*WebSocketAdapter) Serve

func (s *WebSocketAdapter) Serve() (bool, error)

func (*WebSocketAdapter) SetControlMessageHandler

func (s *WebSocketAdapter) SetControlMessageHandler(handler MessageHandler)

func (*WebSocketAdapter) SetDataMessageHandler

func (s *WebSocketAdapter) SetDataMessageHandler(handler MessageHandler)

func (*WebSocketAdapter) SetFeaturesContainer

func (s *WebSocketAdapter) SetFeaturesContainer(featuresContainer features.Container)

func (*WebSocketAdapter) SetPongHandler

func (s *WebSocketAdapter) SetPongHandler(handler func())

func (*WebSocketAdapter) WaitReady

func (s *WebSocketAdapter) WaitReady()

func (*WebSocketAdapter) WriteControlMessage

func (s *WebSocketAdapter) WriteControlMessage(message []byte) error

func (*WebSocketAdapter) WriteDataMessage

func (s *WebSocketAdapter) WriteDataMessage(message []byte) error

func (*WebSocketAdapter) WritePingMessage

func (s *WebSocketAdapter) WritePingMessage() error

type WebTransportAdapter

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

func NewWebTransportAdapter

func NewWebTransportAdapter(conn *webtransport.Session, netConn net.Conn, serializationType commands.SerializationType, isServer bool) *WebTransportAdapter

func (*WebTransportAdapter) Close

func (s *WebTransportAdapter) Close() error

func (*WebTransportAdapter) GetCommandSerializationType

func (s *WebTransportAdapter) GetCommandSerializationType() commands.SerializationType

func (*WebTransportAdapter) GetTLSConnectionState

func (s *WebTransportAdapter) GetTLSConnectionState() (tls.ConnectionState, bool)

func (*WebTransportAdapter) IsClient

func (s *WebTransportAdapter) IsClient() bool

func (*WebTransportAdapter) IsServer

func (s *WebTransportAdapter) IsServer() bool

func (*WebTransportAdapter) LocalAddr

func (s *WebTransportAdapter) LocalAddr() net.Addr

func (*WebTransportAdapter) MaxDataPayloadLen

func (s *WebTransportAdapter) MaxDataPayloadLen() uint16

func (*WebTransportAdapter) Name

func (s *WebTransportAdapter) Name() string

func (*WebTransportAdapter) RefreshFeatures

func (s *WebTransportAdapter) RefreshFeatures()

func (*WebTransportAdapter) RemoteAddr

func (s *WebTransportAdapter) RemoteAddr() net.Addr

func (*WebTransportAdapter) Serve

func (s *WebTransportAdapter) Serve() (bool, error)

func (*WebTransportAdapter) SetControlMessageHandler

func (s *WebTransportAdapter) SetControlMessageHandler(handler MessageHandler)

func (*WebTransportAdapter) SetDataMessageHandler

func (s *WebTransportAdapter) SetDataMessageHandler(handler MessageHandler)

func (*WebTransportAdapter) SetFeaturesContainer

func (s *WebTransportAdapter) SetFeaturesContainer(featuresContainer features.Container)

func (*WebTransportAdapter) SetPongHandler

func (s *WebTransportAdapter) SetPongHandler(handler func())

func (*WebTransportAdapter) WaitReady

func (s *WebTransportAdapter) WaitReady()

func (*WebTransportAdapter) WriteControlMessage

func (s *WebTransportAdapter) WriteControlMessage(message []byte) error

func (*WebTransportAdapter) WriteDataMessage

func (s *WebTransportAdapter) WriteDataMessage(message []byte) error

func (*WebTransportAdapter) WritePingMessage

func (s *WebTransportAdapter) WritePingMessage() error

Jump to

Keyboard shortcuts

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