xginplusws

package
v0.3.32 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: BSD-3-Clause-Clear Imports: 6 Imported by: 0

Documentation

Overview

长连接相关依赖支持 继承外部 xginplus 组件

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

将 WS 长连接转化为gin可以直接插入的路由组

ws	处理 WS 方法的结构体列表
fc	针对此分组下的追加配置项

Types

type Websocket

type Websocket interface {
	// WS链接打开事件
	Open(*xginplus.Context) error
	// WS链接接收消息事件
	Pull(*xginplus.Context, []byte) error
	// WS链接发送消息事件
	// 此消息的返回值为给对应客户端发送的消息
	// any 为json串行化后发送给客户端的消息,bool来判断是否需要发送给客户端
	Push(*xginplus.Context) (any, bool)
	// WS链接意外关闭事件
	Close(*xginplus.Context)
}

WS消息结构体支持

Jump to

Keyboard shortcuts

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