31 lines
589 B
Go
31 lines
589 B
Go
package gateway
|
|
|
|
import (
|
|
"go_dreamfactory/pb"
|
|
|
|
"go_dreamfactory/lego/base"
|
|
"go_dreamfactory/lego/core"
|
|
)
|
|
|
|
type (
|
|
// IAgent 用户代理对象接口定义
|
|
IAgent interface {
|
|
SessionId() string
|
|
IP() string
|
|
UserId() string
|
|
WorkerId() string
|
|
Bind(uId string, wId string)
|
|
UnBind()
|
|
WriteMsg(msg *pb.UserMessage) (err error)
|
|
Close() //主动关闭接口
|
|
}
|
|
// IGateway 网关模块 接口定义
|
|
IGateway interface {
|
|
core.IModule
|
|
Service() base.IRPCXService
|
|
Connect(a IAgent)
|
|
DisConnect(a IAgent)
|
|
GetMsgDistribute(mtype, stype string) (rule string, ok bool)
|
|
}
|
|
)
|