ginwebsocket

package
v4.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

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

func NewRouter

func NewRouter(path, configPath string) *Router

func (*Router) GetClientManager

func (r *Router) GetClientManager() *websocket.ClientManager

func (*Router) OnTextMessageController

func (r *Router) OnTextMessageController(scene string, controller websocket.TextMessageController)

func (*Router) Register

func (r *Router) Register(rg *gin.RouterGroup)

Register 将 WebSocket 路由注册到指定 RouterGroup,供 HTTPHandler 使用。

func (*Router) SetAuthorizationFunc

func (r *Router) SetAuthorizationFunc(f func(ctx context.Context, r *http.Request, w http.ResponseWriter) (returnCtx context.Context, isAuthorized bool, userId int64))

func (*Router) SetBeforeFunc

func (r *Router) SetBeforeFunc(f func(ctx context.Context, r *http.Request, w http.ResponseWriter) (returnCtx context.Context, isAuthorized bool, userId int64))

func (*Router) SetClientCloseFunc

func (r *Router) SetClientCloseFunc(f func(context.Context, string))

Jump to

Keyboard shortcuts

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