Documentation
¶
Index ¶
- func New(bootstrap iface.Bootstrap, conn net.Conn, connId uint32, maxPackageSize int) iface.Connection
- func NewConnManager() iface.ConnManager
- func NewPipeline(conn iface.Connection) iface.Pipeline
- func NewRequest(conn iface.Connection, msg []byte) iface.Request
- type ChannelContext
- type ConnManager
- type Connection
- func (c *Connection) AddCronFunc(spec string, cmd func()) error
- func (c *Connection) GetConn() net.Conn
- func (c *Connection) GetConnID() uint32
- func (c *Connection) GetPipeline() iface.Pipeline
- func (c *Connection) RemoteAddr() net.Addr
- func (c *Connection) RemoveCronFunc(id cron.EntryID)
- func (c *Connection) Start()
- func (c *Connection) StartReader()
- func (c *Connection) StartWriter()
- func (c *Connection) Stop()
- func (c *Connection) Write(msg []byte) error
- type Pipeline
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConnManager ¶
func NewConnManager() iface.ConnManager
func NewPipeline ¶
func NewPipeline(conn iface.Connection) iface.Pipeline
func NewRequest ¶
func NewRequest(conn iface.Connection, msg []byte) iface.Request
Types ¶
type ChannelContext ¶
func NewContext ¶
func NewContext(ctx context.Context, pipeline iface.Pipeline, handler iface.ChannelHandler) *ChannelContext
func (*ChannelContext) DoHandle ¶
func (c *ChannelContext) DoHandle(msg []byte)
DoHandle 调用当前处理器处理消息
func (*ChannelContext) FireRead ¶
func (c *ChannelContext) FireRead(msg []byte)
FireRead 调用链表当中的下一个处理器
func (*ChannelContext) GetConnection ¶
func (c *ChannelContext) GetConnection() iface.Connection
func (*ChannelContext) GetHandler ¶
func (c *ChannelContext) GetHandler() iface.ChannelHandler
type ConnManager ¶
type ConnManager struct {
// contains filtered or unexported fields
}
func (*ConnManager) Add ¶
func (c *ConnManager) Add(conn iface.Connection)
func (*ConnManager) Clear ¶
func (c *ConnManager) Clear()
func (*ConnManager) Get ¶
func (c *ConnManager) Get(connId uint32) (iface.Connection, bool)
func (*ConnManager) Remove ¶
func (c *ConnManager) Remove(connId uint32)
func (*ConnManager) Size ¶
func (c *ConnManager) Size() int
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) AddCronFunc ¶
func (c *Connection) AddCronFunc(spec string, cmd func()) error
func (*Connection) GetConn ¶
func (c *Connection) GetConn() net.Conn
func (*Connection) GetConnID ¶
func (c *Connection) GetConnID() uint32
func (*Connection) GetPipeline ¶
func (c *Connection) GetPipeline() iface.Pipeline
func (*Connection) RemoteAddr ¶
func (c *Connection) RemoteAddr() net.Addr
func (*Connection) RemoveCronFunc ¶
func (c *Connection) RemoveCronFunc(id cron.EntryID)
func (*Connection) Start ¶
func (c *Connection) Start()
func (*Connection) StartReader ¶
func (c *Connection) StartReader()
func (*Connection) Stop ¶
func (c *Connection) Stop()
func (*Connection) Write ¶
func (c *Connection) Write(msg []byte) error
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
func (*Pipeline) AddLast ¶
func (p *Pipeline) AddLast(handler iface.ChannelHandler)
func (*Pipeline) GetConnection ¶
func (p *Pipeline) GetConnection() iface.Connection
Click to show internal directories.
Click to hide internal directories.