Documentation
¶
Index ¶
- Constants
- type Agent
- func (a *Agent) Close()
- func (a *Agent) Kick(reason interface{}) error
- func (a *Agent) Push(route string, val interface{}) error
- func (a *Agent) RPC(route string, val interface{}) error
- func (a *Agent) RemoteAddr() net.Addr
- func (a *Agent) Response(mid uint64, v interface{}, isError ...bool) error
- func (a *Agent) Run()
- func (a *Agent) Send(typ cherryMessage.Type, route string, mid uint64, v interface{}, isError bool) (err error)
- func (a *Agent) SendRaw(bytes []byte) error
- func (a *Agent) SetLastAt()
- func (a *Agent) SetStatus(state int32)
- func (a *Agent) Status() int32
- type AgentRemote
- type Options
- type PacketListener
- type RPCHandler
Constants ¶
View Source
const ( Init = iota WaitAck Working Closed )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
Options
Session *cherrySession.Session // session
// contains filtered or unexported fields
}
func (*Agent) Close ¶
func (a *Agent) Close()
Close closes the Agent, clean inner state and close low-level connection.
func (*Agent) RemoteAddr ¶
RemoteAddr, implementation for session.NetworkEntity interface returns the remote network address.
func (*Agent) Response ¶
Response, implementation for session.NetworkEntity interface Response message to session
type AgentRemote ¶
type AgentRemote struct {
Session *cherrySession.Session
// contains filtered or unexported fields
}
type Options ¶
type Options struct {
Heartbeat time.Duration // heartbeat(sec)
DataCompression bool // data compression
PacketListener map[cherryPacket.Type]PacketListener // process packet listener function
RPCHandler RPCHandler // rpc handler
}
type PacketListener ¶
type PacketListener func(agent *Agent, packet cherryFacade.IPacket)
process packet listener function
type RPCHandler ¶
type RPCHandler func(session *cherrySession.Session, msg *cherryMessage.Message)
Click to show internal directories.
Click to hide internal directories.