From 2520655fbdad52088f23ea3516f6a0e3792b95d6 Mon Sep 17 00:00:00 2001 From: black1552 Date: Fri, 27 Feb 2026 17:54:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(pool):=20=E6=B7=BB=E5=8A=A0SQLite=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=B1=A0=E5=AE=9E=E7=8E=B0=E5=B9=B6=E9=9B=86=E6=88=90?= =?UTF-8?q?=E5=88=B0TCP=E5=92=8CWebSocket=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增pool包,包含ConnType连接类型和ConnectionInfo连接信息结构体 - 实现SQLitePool连接池,支持添加、获取、删除、更新连接操作 - 为TCP服务器集成SQLite连接池,存储连接信息到数据库 - 为WebSocket管理器集成SQLite连接池,存储连接信息到数据库 - 在TCP和WebSocket的连接生命周期中同步更新SQLite连接状态 - 添加GetAllConnIDs方法获取所有在线连接ID列表 - 在示例代码中添加错误处理和测试功能 --- .idea/GOHCache.xml | 281 +++++++++++++++++++++++++++++++++------------ pool/common.go | 25 ++++ pool/sqlite.go | 247 +++++++++++++++++++++++++++++++++++++++ tcp/example.go | 51 +++++++- tcp/tcp.go | 82 ++++++++++++- ws/example.go | 37 +++++- ws/websocket.go | 99 ++++++++++++++-- 7 files changed, 731 insertions(+), 91 deletions(-) create mode 100644 pool/common.go create mode 100644 pool/sqlite.go diff --git a/.idea/GOHCache.xml b/.idea/GOHCache.xml index 2bdc17b..bbc7165 100644 --- a/.idea/GOHCache.xml +++ b/.idea/GOHCache.xml @@ -17,6 +17,20 @@ + + + + + + + + + + + + @@ -34,6 +48,8 @@ + @@ -41,17 +57,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -83,28 +131,30 @@ + + + + + + + + - + - - - - - - - @@ -125,6 +175,8 @@ + @@ -132,6 +184,7 @@ + @@ -139,6 +192,7 @@ + @@ -146,24 +200,11 @@ + - - - - - - - - - - - - @@ -178,10 +219,140 @@ + + + + + + -