44fe05ff62f2efdfe364b9d4f5fd20a8a002a21d
- Upgrade Go version to 1.24.0 and update toolchain. - Update various dependencies in go.mod and go.sum, including: - Upgrade `fasthttp/websocket` to v1.5.12 - Upgrade `fsnotify/fsnotify` to v1.9.0 - Upgrade `valyala/fasthttp` to v1.58.0 - Add new dependencies for `bytedance/sonic` and `google/uuid`. - Refactor bot configuration in config.toml to support multiple bot protocols, including "milky" and "onebot11". - Modify internal configuration structures to accommodate new bot settings. - Enhance event dispatcher with metrics tracking and asynchronous processing capabilities. - Implement WebSocket connection management with heartbeat and reconnection logic. - Update server handling for bot management and event publishing.
CellBot 多机器人服务端
基于Go语言的高性能多机器人服务端系统,参考OneBot12协议设计通用框架。
特性
- 🚀 高性能fasthttp网络层
- 🔄 基于channel的发布订阅事件总线
- 🎯 依赖注入容器(Uber Fx)
- ⚡ TOML配置热重载
- 🔌 通用协议接口,支持扩展
- 🤖 多机器人实例管理
技术栈
- Go 1.21+
- fasthttp - 高性能网络IO
- Uber Fx - 依赖注入
- BurntSushi/toml - 配置解析
- fsnotify - 文件监听
- zap - 高性能日志
项目结构
cellbot/
├── cmd/server/ # 应用入口
├── internal/
│ ├── config/ # 配置管理
│ ├── protocol/ # 协议接口
│ ├── adapter/ # 协议适配器
│ ├── engine/ # 核心引擎
│ └── di/ # 依赖注入
├── pkg/
│ └── net/ # 网络封装
└── configs/ # 配置文件
快速开始
# 安装依赖
go mod download
# 运行服务
go run cmd/server/main.go
开发
# 运行测试
go test ./...
# 运行基准测试
go test -bench=. -benchmem
Description
Languages
Go
100%