Documentation
¶
Index ¶
- Constants
- type GatewayConnInfo
- type GatewayService
- type GatewaySessionRunner
- type LogicService
- func (this *LogicService) Close()
- func (this *LogicService) GetMemoryState() (value string)
- func (this *LogicService) GetMessageChan() <-chan RedisExchange
- func (this *LogicService) KickSession(sessionId string)
- func (this *LogicService) SetMemoryState(value string)
- func (this *LogicService) WriteSession(sessionId string, msgData []byte)
- type RedisExchange
- type RedisInfo
Constants ¶
View Source
const ( MTLogicKick = `MTLogicKick` // GatewayIn: logic踢session MTLogicWrite = `MTLogicWrite` // GatewayIn: logic向session写数据 MTGatewayNew = `MTGatewayNew` // LogicIn: gateway接收到了一条新链接 MTGatewayRead = `MTGatewayRead` // LogicIn: gateway从已有的链接上读取到了一条消息 MTGatewayClose = `MTGatewayClose` // LogicIn: gateway关闭了一套链接 MTTimeout = `MTTimeout` // 无: 每秒钟LogicService.GetMessageChan会被自动放一条该消息, 方便处理逻辑 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GatewayConnInfo ¶
type GatewayService ¶
type GatewayService struct {
// contains filtered or unexported fields
}
func NewGatewayService ¶
func NewGatewayService(req RedisInfo) *GatewayService
func (*GatewayService) KickSession ¶
func (this *GatewayService) KickSession(sessionId string)
func (*GatewayService) NewSession ¶
func (this *GatewayService) NewSession(runner GatewaySessionRunner)
func (*GatewayService) WriteSession ¶
func (this *GatewayService) WriteSession(sessionId string, msg RedisExchange)
type GatewaySessionRunner ¶
type LogicService ¶
type LogicService struct {
// contains filtered or unexported fields
}
func NewLogicService ¶
func NewLogicService(req RedisInfo) *LogicService
func (*LogicService) Close ¶
func (this *LogicService) Close()
func (*LogicService) GetMemoryState ¶
func (this *LogicService) GetMemoryState() (value string)
func (*LogicService) GetMessageChan ¶
func (this *LogicService) GetMessageChan() <-chan RedisExchange
func (*LogicService) KickSession ¶
func (this *LogicService) KickSession(sessionId string)
func (*LogicService) SetMemoryState ¶
func (this *LogicService) SetMemoryState(value string)
func (*LogicService) WriteSession ¶
func (this *LogicService) WriteSession(sessionId string, msgData []byte)
type RedisExchange ¶
type RedisInfo ¶
func (*RedisInfo) GatewaySession ¶
hash, gateway上的所有链接的 [sessionId, 创建时间]
func (*RedisInfo) MemoryState ¶
kv, logic的内存状态,logic启动的时候加载, 退出的时候保存
Click to show internal directories.
Click to hide internal directories.