增加建立以及断开连接时,移除连接

This commit is contained in:
2021-04-08 18:36:17 +08:00
parent cf11a23a9d
commit 9b826dfae7
4 changed files with 97 additions and 0 deletions

26
storage/IStorage.go Normal file
View File

@ -0,0 +1,26 @@
// Package storage ...
//
// Description : 各种内存数据的管理,基于接口,可自己重新实现管理实例
//
// Author : go_developer@163.com<张德满>
//
// Date : 2021-04-08 5:29 下午
package storage
import "github.com/go-developer/websocket/context"
// IConnection 连接管理接口定义
//
// Author : go_developer@163.com<张德满>
//
// Date : 5:30 下午 2021/4/8
type IConnection interface {
// Store 存储
Store(ctx *context.WSContext)
// Del 移除
Del(ctx *context.WSContext)
// GetCtxList 获取连接列表
GetCtxList(cidList ...string) []*context.WSContext
// Clear 清空连接
Clear(message string)
}