Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMemPair ¶
func NewMemPair() (*MemConnection, *MemConnection)
NewMemPair creates two fully connected endpoints.
Types ¶
type Connection ¶
type MemConnection ¶
MemConnection implements transport.Connection for in-memory tests.
func (*MemConnection) Close ¶
func (m *MemConnection) Close(reason string) error
type WSConnection ¶
func (*WSConnection) Close ¶
func (w *WSConnection) Close(reason string) error
type WSProvider ¶
type WSProvider struct {
// contains filtered or unexported fields
}
WSProvider encapsulates the logic for establishing the connection.
func NewWSProvider ¶
func NewWSProvider(logger *slog.Logger) *WSProvider
func (*WSProvider) Dial ¶
func (p *WSProvider) Dial(ctx context.Context, url string) (Connection, error)
Dial connects to a server (client side)
func (*WSProvider) Listen ¶
func (p *WSProvider) Listen(ctx context.Context, addr string, found chan<- Connection) error
Server is waiting for a connection (server-side) We use a channel to reconnect after the upgrade
type WSService ¶
type WSService interface {
Listen(addr string, found chan<- Connection) error
Dial(ctx context.Context, url string) (Connection, error)
}
Click to show internal directories.
Click to hide internal directories.