server

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QuicServer

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

func NewQuicServer

func NewQuicServer(ctx context.Context, address string) *QuicServer

func (*QuicServer) GetConnections

func (qs *QuicServer) GetConnections() map[string]net.Conn

func (*QuicServer) OnMessageReceived

func (qs *QuicServer) OnMessageReceived(handler func([]byte))

func (*QuicServer) Shutdown

func (qs *QuicServer) Shutdown()

func (*QuicServer) Start

func (qs *QuicServer) Start(ctx context.Context)

type Server

type Server interface {
	Start(context.Context)
	OnMessageReceived(handler func([]byte))
	GetConnections() map[string]net.Conn
	Shutdown()
}

func NewServer

func NewServer(addr string, protocol string) (Server, error)

type TcpServer

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

func NewTcpServer

func NewTcpServer(serveAddress string) *TcpServer

func (*TcpServer) GetConnections

func (server *TcpServer) GetConnections() map[string]net.Conn

func (*TcpServer) OnMessageReceived

func (server *TcpServer) OnMessageReceived(handler func(msg []byte))

func (*TcpServer) Shutdown

func (server *TcpServer) Shutdown()

func (*TcpServer) Start

func (server *TcpServer) Start(ctx context.Context)

type WsServer

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

func NewWsServerWithCerts

func NewWsServerWithCerts(serveAddress string, tlsConfig *tls.Config) *WsServer

func (*WsServer) GetConnections

func (server *WsServer) GetConnections() map[string]net.Conn

func (*WsServer) OnMessageReceived

func (server *WsServer) OnMessageReceived(handler func([]byte))

func (*WsServer) Shutdown

func (ws *WsServer) Shutdown()

func (*WsServer) Start

func (ws *WsServer) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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