This commit is contained in:
孟帅
2023-05-10 23:54:50 +08:00
parent bbe655a4d8
commit 49a96750bf
314 changed files with 15138 additions and 6244 deletions

View File

@@ -1,19 +1,8 @@
package tcp
import "github.com/gogf/gf/v2/os/gtime"
// 定时任务
const (
cronHeartbeatVerify = "tcpHeartbeatVerify"
cronHeartbeat = "tcpHeartbeat"
cronAuthVerify = "tcpAuthVerify"
)
// 认证分组
const (
ClientGroupCron = "cron" // 定时任务
ClientGroupQueue = "queue" // 消息队列
ClientGroupAuth = "auth" // 服务授权
import (
"github.com/gogf/gf/v2/net/gtcp"
"github.com/gogf/gf/v2/os/gtime"
)
// AuthMeta 认证元数据
@@ -25,5 +14,11 @@ type AuthMeta struct {
EndAt *gtime.Time `json:"-"`
}
type Context struct {
Conn *gtcp.Conn `json:"conn"`
Auth *AuthMeta `json:"auth"` // 认证元数据
TraceID string `json:"traceID"` // 链路ID
}
// CallbackEvent 回调事件
type CallbackEvent func()