agent

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// StatusStart status
	StatusStart int32
	// StatusHandshake status
	StatusHandshake
	// StatusWorking status
	StatusWorking
	// StatusClosed status
	StatusClosed
)

Variables

View Source
var (
	ErrCloseClosedSession = errors.New("close closed session")
)

Functions

This section is empty.

Types

type Agent

type Agent struct {
	AgentID int64 // user id
	// contains filtered or unexported fields
}

Agent corresponds to a user and is used for storing raw Conn information

func (*Agent) GetConnInfo

func (a *Agent) GetConnInfo() *acceptor.ConnInfo

func (*Agent) GetId

func (a *Agent) GetId() int64

func (*Agent) GetLastTimeOnline

func (a *Agent) GetLastTimeOnline() int64

func (*Agent) GetLatency

func (a *Agent) GetLatency() int64

func (*Agent) GetSession

func (a *Agent) GetSession() *session.Session

func (*Agent) GetStatus

func (a *Agent) GetStatus() int32

func (*Agent) IsClosed

func (a *Agent) IsClosed() bool

func (*Agent) LocalAddr

func (a *Agent) LocalAddr() net.Addr

func (*Agent) RemoteAddr

func (a *Agent) RemoteAddr() net.Addr

func (*Agent) Send

func (a *Agent) Send(in interface{}, name ...string) error

Send Message

func (*Agent) SendData added in v0.1.1

func (a *Agent) SendData(data []byte)

func (*Agent) SetLastAt

func (a *Agent) SetLastAt()

func (*Agent) SetStatus

func (a *Agent) SetStatus(state int32)

func (*Agent) Start

func (a *Agent) Start()

func (*Agent) Stop

func (a *Agent) Stop() error

Stop close the agent

type AgentFacotry

type AgentFacotry struct {
	// contains filtered or unexported fields
}

AgentFacotry is the facotry to create the agent

func NewAgentFactory

func NewAgentFactory(config *config.Config,
	pool session.SessionPool,
	messageServer *message.MessageServer) *AgentFacotry

func (*AgentFacotry) NewAgent

func (af *AgentFacotry) NewAgent(conn acceptor.AcceptorConn) *Agent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL