WsServer

package
v0.0.0-...-a47367c Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: MulanPSL-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const OnClose string = "on_tcp_close"
View Source
const OnConnect string = "on_tcp_connect"
View Source
const OnDisConnect string = "on_tcp_disconnect"
View Source
const OnError string = "on_tcp_err"
View Source
const OnMessage string = "on_tcp_message"
View Source
const OnStart string = "on_tcp_start"

Variables

This section is empty.

Functions

This section is empty.

Types

type WsServer

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

func (*WsServer) Close

func (server *WsServer) Close()

func (*WsServer) GetConnections

func (server *WsServer) GetConnections() []*websocket.Conn

func (*WsServer) GetRequest

func (server *WsServer) GetRequest(con *websocket.Conn) *http.Request

func (*WsServer) OnClose

func (server *WsServer) OnClose(fun func(conn *websocket.Conn))

func (*WsServer) OnConnect

func (server *WsServer) OnConnect(fun func(connection *websocket.Conn))

func (*WsServer) OnDisConnect

func (server *WsServer) OnDisConnect(fun func(connection *websocket.Conn))

func (*WsServer) OnError

func (server *WsServer) OnError(fun func(err error))

func (*WsServer) OnMessage

func (server *WsServer) OnMessage(fun func(connection *websocket.Conn, message string))

func (*WsServer) OnStart

func (server *WsServer) OnStart(fun func())

func (*WsServer) Start

func (server *WsServer) Start(port int, url string, debug bool, reusePort bool)

func (*WsServer) StartWithServerMux

func (server *WsServer) StartWithServerMux(port int, url string, debug bool, serverMux *http.ServeMux)

Jump to

Keyboard shortcuts

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