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 uint, v interface{}, isError ...bool) error
- func (a *Agent) Run()
- func (a *Agent) Send(typ cherryMessage.Type, route string, mid uint, v interface{}, isError bool) (err error)
- func (a *Agent) SendRaw(bytes []byte) error
- func (a *Agent) SetLastAt()
- type AgentRemote
- func (a *AgentRemote) Close()
- func (a *AgentRemote) Kick(reason interface{}) error
- func (a *AgentRemote) Push(route string, val interface{}) error
- func (a *AgentRemote) RPC(route string, val interface{}) error
- func (a *AgentRemote) RemoteAddr() net.Addr
- func (a *AgentRemote) Response(mid uint, val interface{}, isError ...bool) error
- func (a *AgentRemote) SendRaw(bytes []byte) error
- type Options
- type RPCHandler
Constants ¶
View Source
const (
WriteBacklog = 64
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
*Options
cherryFacade.IApplication
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.
type AgentRemote ¶
type AgentRemote struct {
Session *cherrySession.Session
// contains filtered or unexported fields
}
func (*AgentRemote) Close ¶ added in v1.1.1
func (a *AgentRemote) Close()
func (*AgentRemote) Kick ¶ added in v1.1.1
func (a *AgentRemote) Kick(reason interface{}) error
func (*AgentRemote) Push ¶ added in v1.1.1
func (a *AgentRemote) Push(route string, val interface{}) error
func (*AgentRemote) RPC ¶ added in v1.1.1
func (a *AgentRemote) RPC(route string, val interface{}) error
func (*AgentRemote) RemoteAddr ¶ added in v1.1.1
func (a *AgentRemote) RemoteAddr() net.Addr
func (*AgentRemote) Response ¶ added in v1.1.1
func (a *AgentRemote) Response(mid uint, val interface{}, isError ...bool) error
func (*AgentRemote) SendRaw ¶ added in v1.1.1
func (a *AgentRemote) SendRaw(bytes []byte) error
type Options ¶
type Options struct {
Heartbeat time.Duration // heartbeat(sec)
Command map[cherryPacket.Type]cherryCommand.ICommand // commands
RPCHandler RPCHandler // rpc handler
}
type RPCHandler ¶
type RPCHandler func(session *cherrySession.Session, msg *cherryMessage.Message)
Click to show internal directories.
Click to hide internal directories.