Documentation ¶
Index ¶
- Constants
- func BindSID(agent *Agent)
- func BindUID(sid cfacade.SID, uid cfacade.UID) error
- func Broadcast(iActor cfacade.IActor, agentPath string, uidList []int64, allUID bool, ...)
- func BuildSession(agent *Agent, msg *pmessage.Message) *cproto.Session
- func ClusterLocalDataRoute(agent *Agent, session *cproto.Session, route *pmessage.Route, ...) error
- func Count() int
- func DefaultDataRoute(agent *Agent, route *pmessage.Route, msg *pmessage.Message)
- func ForeachAgent(fn func(a *Agent))
- func Kick(iActor cfacade.IActor, agentPath, sid string, reason interface{}, closed bool)
- func LocalDataRoute(agent *Agent, session *cproto.Session, route *pmessage.Route, ...)
- func NewActor(agentActorID string) *actor
- func Push(iActor cfacade.IActor, agentPath, sid, route string, v interface{})
- func Response(iActor cfacade.IActor, agentPath, sid string, mid uint32, v interface{})
- func ResponseCode(iActor cfacade.IActor, agentPath, sid string, mid uint32, statusCode int32)
- func Unbind(sid cfacade.SID)
- type ActorBase
- func (p *ActorBase) Broadcast(agentPath string, uidList []int64, allUID bool, route string, v interface{})
- func (p *ActorBase) Kick(session *cproto.Session, reason interface{}, closed bool)
- func (p *ActorBase) Push(session *cproto.Session, route string, v interface{})
- func (p *ActorBase) Response(session *cproto.Session, v interface{})
- func (p *ActorBase) ResponseCode(session *cproto.Session, statusCode int32)
- type Agent
- func (a *Agent) AddOnClose(fn OnCloseFunc)
- func (a *Agent) Bind(uid cfacade.UID) error
- func (a *Agent) Close()
- func (a *Agent) IsBind() bool
- func (a *Agent) Kick(reason interface{}, closed bool)
- func (a *Agent) Push(route string, val interface{})
- func (a *Agent) RemoteAddr() string
- func (a *Agent) Response(session *cproto.Session, v interface{}, isError ...bool)
- func (a *Agent) ResponseCode(session *cproto.Session, statusCode int32, isError ...bool)
- func (a *Agent) ResponseMID(mid uint32, v interface{}, isError ...bool)
- func (a *Agent) Run()
- func (a *Agent) SID() cfacade.SID
- func (a *Agent) SendPacket(typ pomeloPacket.Type, data []byte)
- func (a *Agent) SendRaw(bytes []byte)
- func (a *Agent) Session() *cproto.Session
- func (a *Agent) SetLastAt()
- func (a *Agent) SetState(state int32) bool
- func (a *Agent) State() int32
- func (a *Agent) UID() cfacade.UID
- func (a *Agent) Unbind()
- type Command
- type DataRouteFunc
- type OnCloseFunc
- type OnNewAgentFunc
- type PacketFunc
Constants ¶
View Source
const ( ResponseFuncName = "response" PushFuncName = "push" KickFuncName = "kick" BroadcastName = "broadcast" )
View Source
const ( AgentInit int32 = 0 AgentWaitAck int32 = 1 AgentWorking int32 = 2 AgentClosed int32 = 3 )
View Source
const ( DataHeartbeat = "heartbeat" DataDict = "dict" DataSerializer = "serializer" )
Variables ¶
This section is empty.
Functions ¶
func ClusterLocalDataRoute ¶
func DefaultDataRoute ¶
DefaultDataRoute 默认的消息路由
func ForeachAgent ¶
func ForeachAgent(fn func(a *Agent))
func LocalDataRoute ¶
func ResponseCode ¶
Types ¶
type Agent ¶
type Agent struct { cfacade.IApplication // app // contains filtered or unexported fields }
func (*Agent) AddOnClose ¶
func (a *Agent) AddOnClose(fn OnCloseFunc)
func (*Agent) RemoteAddr ¶
func (*Agent) ResponseCode ¶
func (*Agent) ResponseMID ¶
func (*Agent) SendPacket ¶
func (a *Agent) SendPacket(typ pomeloPacket.Type, data []byte)
type DataRouteFunc ¶
type OnCloseFunc ¶
type OnCloseFunc func(*Agent)
type OnNewAgentFunc ¶
type OnNewAgentFunc func(newAgent *Agent)
type PacketFunc ¶
Click to show internal directories.
Click to hide internal directories.