Versions in this module Expand all Collapse all v1 v1.0.1 Mar 12, 2020 Changes in this version + const RPC_GateAgentBuild + const RPC_GateAgentClose + const RPC_GateAgentSendMsg + const RPC_GateAgentUnBuild + const Rpc_GateAgentsIsKeep + const Rpc_GateRoute + const Rpc_GateRouteRegister + func NewLocalSession(module IGateModule, data map[string]interface{}) (s core.IUserSession, err error) + func NewRemoteSession(service base.IClusterService, data map[string]interface{}) (s core.IUserSession, err error) + type AgentBase struct + Agent IAgent + Conn IConn + Isclose bool + Module IGateModule + func (this *AgentBase) Destory() + func (this *AgentBase) IP() string + func (this *AgentBase) Id() string + func (this *AgentBase) IsClosed() bool + func (this *AgentBase) OnClose() + func (this *AgentBase) OnCloseWait() + func (this *AgentBase) OnInit(module IGateModule, coon IConn, agent IAgent) (err error) + func (this *AgentBase) OnRecover(msg proto.IMessage) + func (this *AgentBase) OnRun() + func (this *AgentBase) RevNum() int64 + func (this *AgentBase) SendNum() int64 + func (this *AgentBase) WriteMsg(msg proto.IMessage) error + type AgentMgrComp struct + Agents *cont.BeeMap + func (this *AgentMgrComp) Close(aId string) (result string, err string) + func (this *AgentMgrComp) Connect(a IAgent) + func (this *AgentMgrComp) Destroy() (err error) + func (this *AgentMgrComp) DisConnect(a IAgent) + func (this *AgentMgrComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, ...) (err error) + func (this *AgentMgrComp) SendMsg(aId string, msg proto.IMessage) (result int, err string) + type Gate struct + func (this *Gate) CloseAgent(sId string) (result string, err string) + func (this *Gate) Connect(a IAgent) + func (this *Gate) DisConnect(a IAgent) + func (this *Gate) OnRoute(a IAgent, msg proto.IMessage) (code int, err string) + func (this *Gate) RegisterLocalRoute(comId uint16, ...) + func (this *Gate) SendMsg(sId string, msg proto.IMessage) (result int, err string) + func (this *Gate) UnRegisterLocalRoute(comId uint16, f func(session core.IUserSession, msg proto.IMessage)) + type IAgent interface + Destory func() + GetSessionData func() map[string]interface{} + IP func() string + Id func() string + IsClosed func() bool + OnClose func() + OnCloseWait func() + OnInit func(gate IGateModule, coon IConn, agent IAgent) (err error) + OnRecover func(msg proto.IMessage) + OnRun func() + RevNum func() int64 + SendNum func() int64 + WriteMsg func(msg proto.IMessage) (err error) + type IConn interface + Close func() + Read func(b []byte) (n int, err error) + RemoteAddr func() net.Addr + Write func(b []byte) (n int, err error) + func NewTcpConn(conn net.Conn) IConn + func NewWsConn(conn *websocket.Conn) IConn + type IGateModule interface + CloseAgent func(sId string) (result string, err string) + Connect func(a IAgent) + DisConnect func(a IAgent) + OnRoute func(a IAgent, msg proto.IMessage) (code int, err string) + RegisterLocalRoute func(comId uint16, ...) + SendMsg func(sId string, msg proto.IMessage) (result int, err string) + UnRegisterLocalRoute func(comId uint16, f func(session core.IUserSession, msg proto.IMessage)) + type LocalRoute struct + ComId uint16 + Module IGateModule + func NewLocalRoute(module IGateModule, comId uint16, ...) *LocalRoute + func (this *LocalRoute) OnRoute(a IAgent, msg proto.IMessage) (code int, err string) + type LocalRouteMgrComp struct + NewSession func(module IGateModule, data map[string]interface{}) (s core.IUserSession, err error) + func (this *LocalRouteMgrComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, ...) (err error) + func (this *LocalRouteMgrComp) OnRoute(agent IAgent, msg proto.IMessage) (code int, err string) + func (this *LocalRouteMgrComp) RegisterRoute(comId uint16, ...) + func (this *LocalRouteMgrComp) UnRegisterRoute(comId uint16, f func(session core.IUserSession, msg proto.IMessage)) + type LocalSession struct + func (this *LocalSession) Close() (err error) + func (this *LocalSession) GetGateId() string + func (this *LocalSession) GetGateServerId() string + func (this *LocalSession) GetIP() string + func (this *LocalSession) GetSessionId() string + func (this *LocalSession) SendMsg(comdId uint16, msgId uint16, msg interface{}) (err error) + func (this *LocalSession) UpDateMap(data map[string]interface{}) (err error) + type RemoteRoute struct + ComId uint16 + Service base.IClusterService + ServiceType string + func NewRemoteRoute(service base.IClusterService, comId uint16, ...) *RemoteRoute + func (this *RemoteRoute) Count() int32 + func (this *RemoteRoute) OnRoute(a IAgent, msg proto.IMessage) (code int, err string) + func (this *RemoteRoute) RegisterRoute(sNode registry.ServiceNode) (err error) + func (this *RemoteRoute) UnRegisterRoute(sId string) + type RemoteRouteMgrComp struct + NewSession func(service base.IClusterService, data map[string]interface{}) (s core.IUserSession, err error) + func (this *RemoteRouteMgrComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, ...) (err error) + func (this *RemoteRouteMgrComp) OnRoute(agent IAgent, msg proto.IMessage) (code int, err string) + func (this *RemoteRouteMgrComp) RegisterRoute(comId uint16, sId string) (result string, err string) + func (this *RemoteRouteMgrComp) Start() (err error) + func (this *RemoteRouteMgrComp) UnRegisterRoute(comId uint16, sId string) + type RemoteSession struct + func (this *RemoteSession) Close() (err error) + func (this *RemoteSession) GetGateId() string + func (this *RemoteSession) GetGateServerId() string + func (this *RemoteSession) GetIP() string + func (this *RemoteSession) GetSessionId() string + func (this *RemoteSession) SendMsg(comdId uint16, msgId uint16, msg interface{}) (err error) + func (this *RemoteSession) UpDateMap(data map[string]interface{}) (err error) + type SessionData struct + GateServerId string + IP string + SessionId string + type TcpConn struct + func (this *TcpConn) Close() + func (this *TcpConn) Init(conn net.Conn) + func (this *TcpConn) LocalAddr() net.Addr + func (this *TcpConn) Read(b []byte) (int, error) + func (this *TcpConn) RemoteAddr() net.Addr + func (this *TcpConn) SetDeadline(t time.Time) error + func (this *TcpConn) SetReadDeadline(t time.Time) error + func (this *TcpConn) SetWriteDeadline(t time.Time) error + func (this *TcpConn) Write(b []byte) (n int, err error) + type TcpServerComp struct + NewTcpAgent func(gate IGateModule, coon IConn) (IAgent, error) + func (this *TcpServerComp) Destroy() (err error) + func (this *TcpServerComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, ...) (err error) + func (this *TcpServerComp) Start() (err error) + type WSHandler struct + func (handler *WSHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type WsConn struct + func (this *WsConn) Close() + func (this *WsConn) Init(conn *websocket.Conn) + func (this *WsConn) LocalAddr() net.Addr + func (this *WsConn) Read(p []byte) (int, error) + func (this *WsConn) RemoteAddr() net.Addr + func (this *WsConn) SetDeadline(t time.Time) error + func (this *WsConn) SetReadDeadline(t time.Time) error + func (this *WsConn) SetWriteDeadline(t time.Time) error + func (this *WsConn) Write(b []byte) (n int, err error) + type WsServerComp struct + CertFile string + KeyFile string + NewWsAgent func(gate IGateModule, coon IConn) (IAgent, error) + func (this *WsServerComp) Destroy() (err error) + func (this *WsServerComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, ...) (err error) + func (this *WsServerComp) Start() (err error)