Documentation ¶
Index ¶
- type Agent
- type AgentFactory
- type Remote
- func (a *Remote) Close() error
- func (a *Remote) Kick(ctx context.Context) error
- func (a *Remote) Push(route string, v interface{}) error
- func (a *Remote) RemoteAddr() net.Addr
- func (a *Remote) ResponseMID(ctx context.Context, mid uint, v interface{}, isError ...bool) error
- func (a *Remote) SendRequest(ctx context.Context, serverID, reqRoute string, v interface{}) (*protos.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent interface { GetSession() session.Session Push(route string, v interface{}) error ResponseMID(ctx context.Context, mid uint, v interface{}, isError ...bool) error Close() error RemoteAddr() net.Addr String() string GetStatus() int32 Kick(ctx context.Context) error SetLastAt() SetStatus(state int32) Handle() IPVersion() string SendHandshakeResponse() error SendHandshakeErrorResponse() error SendRequest(ctx context.Context, serverID, route string, v interface{}) (*protos.Response, error) AnswerWithError(ctx context.Context, mid uint, err error) }
Agent corresponds to a user and is used for storing raw Conn information
type AgentFactory ¶
AgentFactory factory for creating Agent instances
func NewAgentFactory ¶
func NewAgentFactory( appDieChan chan bool, decoder codec.PacketDecoder, encoder codec.PacketEncoder, serializer serialize.Serializer, heartbeatTimeout time.Duration, messageEncoder message.Encoder, messagesBufferSize int, sessionPool session.SessionPool, metricsReporters []metrics.Reporter, ) AgentFactory
NewAgentFactory ctor
type Remote ¶
Remote corresponding to another server
func NewRemote ¶
func NewRemote( sess *protos.Session, reply string, rpcClient cluster.RPCClient, encoder codec.PacketEncoder, serializer serialize.Serializer, serviceDiscovery cluster.ServiceDiscovery, frontendID string, messageEncoder message.Encoder, sessionPool session.SessionPool, ) (*Remote, error)
NewRemote create new Remote instance
func (*Remote) RemoteAddr ¶
RemoteAddr returns the remote address of the user
func (*Remote) ResponseMID ¶
ResponseMID reponds the message with mid to the user
Click to show internal directories.
Click to hide internal directories.