Versions in this module Expand all Collapse all v1 v1.1.2 Jul 28, 2025 v1.1.1 Jul 28, 2025 Changes in this version + const ChannelChanSize + const ChannelKey + const Int16Size + const Int32Size + const KeyChannelReadLimit + const KeyForReqPath + const KeyForRequest + const KeyForResponse + const KeyIsLD + const KeyLengthInclude + const KeyPacketBytesCount + const KeyReadTimeOut + const KeySkipPacketBytesCount + const KeyWriteTimeOut + func Int16ToByte(v int16) (buf []byte) + func Int16ToByteLD(v int16) (buf []byte) + func Int32ToByte(v int32) (buf []byte) + func Int32ToByteLD(v int32) (buf []byte) + type Attr struct + func NewAttr(params map[string]interface{}) (attr *Attr) + func (attr *Attr) Get(key string) (value interface{}) + func (attr *Attr) GetBool(key string) bool + func (attr *Attr) GetInt(key string) int + func (attr *Attr) GetInt16(key string) int16 + func (attr *Attr) GetInt32(key string) int32 + func (attr *Attr) GetInt64(key string) int64 + func (attr *Attr) GetInt8(key string) int8 + func (attr *Attr) GetString(key string) string + func (attr *Attr) Set(key string, value interface{}) + type Channel interface + Close func() + ID func() string + RemoteAddr func() string + Write func(data []byte) + type ChannelBuilder interface + Create func(conn *net.TCPConn, channelInitializer ChannelInitializer) + type ChannelContext interface + Close func() + ContextAttr func() IAttr + ID func() string + RemoteAddr func() string + Write func(data interface{}) + type ChannelHandler interface + ExceptionCaught func(ctx ChannelContext, err error) + type ChannelInboundHandler interface + ChannelActive func(ctx ChannelContext) (goonNext bool) + ChannelInactive func(ctx ChannelContext) (goonNext bool) + MessageReceived func(ctx ChannelContext, e interface{}) (ret interface{}, goonNext bool) + type ChannelInboundInvoker interface + FireChannelActive func() + FireChannelInactive func() + FireExceptionCaught func(err error) + FireMessageReceived func(event interface{}) + type ChannelInitializer interface + InitChannel func(pipeline ChannelPipeline) + type ChannelOutboundHandler interface + Close func(ctx ChannelContext) + Write func(ctx ChannelContext, e interface{}) (ret interface{}) + type ChannelOutboundInvoker interface + FireChannelClose func() + FireMessageWrite func(e interface{}) + type ChannelPipeline interface + AddFirst func(name string, handler ChannelHandler) (pipeline ChannelPipeline) + AddLast func(name string, handler ChannelHandler) (pipeline ChannelPipeline) + ContextAttr func() IAttr + type DefaultChannelHandlerContext struct + Name string + Next *DefaultChannelHandlerContext + Prev *DefaultChannelHandlerContext + func (this *DefaultChannelHandlerContext) Close() + func (this *DefaultChannelHandlerContext) ContextAttr() IAttr + func (this *DefaultChannelHandlerContext) FireChannelActive() + func (this *DefaultChannelHandlerContext) FireChannelClose() + func (this *DefaultChannelHandlerContext) FireChannelInactive() + func (this *DefaultChannelHandlerContext) FireExceptionCaught(err error) + func (this *DefaultChannelHandlerContext) FireMessageReceived(event interface{}) + func (this *DefaultChannelHandlerContext) FireMessageWrite(event interface{}) + func (this *DefaultChannelHandlerContext) ID() string + func (this *DefaultChannelHandlerContext) RemoteAddr() string + func (this *DefaultChannelHandlerContext) Write(e interface{}) + type DefaultChannelPipeline struct + Head *DefaultChannelHandlerContext + Lock *sync.Mutex + Tail *DefaultChannelHandlerContext + func NewDefaultChannelPipeline(channel Channel) (pipeline *DefaultChannelPipeline) + func (pipeline *DefaultChannelPipeline) AddFirst(name string, handler ChannelHandler) ChannelPipeline + func (pipeline *DefaultChannelPipeline) AddLast(name string, handler ChannelHandler) ChannelPipeline + func (this *DefaultChannelPipeline) ContextAttr() IAttr + func (this *DefaultChannelPipeline) FireChannelActive() + func (this *DefaultChannelPipeline) FireChannelClose() + func (this *DefaultChannelPipeline) FireChannelInactive() + func (this *DefaultChannelPipeline) FireExceptionCaught(err error) + func (this *DefaultChannelPipeline) FireMessageReceived(event interface{}) + func (this *DefaultChannelPipeline) FireMessageWrite(event interface{}) + type DefaultMessageSpliter struct + func NewDefaultMessageSpliter() (this *DefaultMessageSpliter) + func (builder *DefaultMessageSpliter) GetBytesCountForMessageLength() int8 + type HeadHandler struct + func (this *HeadHandler) ChannelActive(ctx ChannelContext) (goonNext bool) + func (this *HeadHandler) ChannelInactive(ctx ChannelContext) (goonNext bool) + func (this *HeadHandler) ExceptionCaught(ctx ChannelContext, err error) + func (this *HeadHandler) MessageReceived(ctx ChannelContext, e interface{}) (ret interface{}, goonNext bool) + type HttpChannel struct + func NewHttpChannel(params map[string]interface{}, w http.ResponseWriter, r *http.Request, ...) (this *HttpChannel) + func (chanenl *HttpChannel) Close() + func (chanenl *HttpChannel) ID() string + func (chanenl *HttpChannel) RemoteAddr() string + func (chanenl *HttpChannel) Start() + func (chanenl *HttpChannel) Write(data []byte) + type IAttr interface + Get func(key string) (value interface{}) + GetBool func(key string) bool + GetInt func(key string) (value int) + GetInt16 func(key string) (value int16) + GetInt32 func(key string) (value int32) + GetInt64 func(key string) (value int64) + GetInt8 func(key string) (value int8) + GetString func(key string) (value string) + Set func(key string, value interface{}) + type IChannelCallBack interface + Active func() + Inactive func() + MsgReceived func(data []byte) + type IChannelError interface + IOReadError func(err error) + IOWriteError func(err error) + type MessageSpliter interface + GetBytesCountForMessageLength func() int8 + type SocketChannel struct + func NewSocketChannel(params map[string]interface{}, conn net.Conn, ...) (this *SocketChannel) + func (chanenl *SocketChannel) Active() + func (chanenl *SocketChannel) Close() + func (chanenl *SocketChannel) ID() string + func (chanenl *SocketChannel) IOReadError(err error) + func (chanenl *SocketChannel) IOWriteError(err error) + func (chanenl *SocketChannel) Inactive() + func (chanenl *SocketChannel) MsgReceived(data []byte) + func (chanenl *SocketChannel) RemoteAddr() string + func (chanenl *SocketChannel) Start() + func (chanenl *SocketChannel) Write(data []byte) + type SocketChannelBuilder struct + func NewSocketChannelBuilder() (this *SocketChannelBuilder) + func (builder *SocketChannelBuilder) Create(conn net.Conn, channelInitializer ChannelInitializer) + func (builder *SocketChannelBuilder) Params(channelParams map[string]interface{}) + type SocketChannelReader struct + func NewSocketChannelReader(mConn net.Conn, mContext Channel, mChannelError IChannelError, ...) (this *SocketChannelReader) + func (reader *SocketChannelReader) Start() + type SocketChannelWriter struct + func NewSocketChannelWriter(mConn net.Conn, mContext Channel, mChannelError IChannelError, ...) (this *SocketChannelWriter) + func (chanenl *SocketChannelWriter) Close() + func (chanenl *SocketChannelWriter) Start() + func (chanenl *SocketChannelWriter) Write(data []byte) + type TailHandler struct + func (this *TailHandler) Close(ctx ChannelContext) + func (this *TailHandler) ExceptionCaught(ctx ChannelContext, err error) + func (this *TailHandler) Write(ctx ChannelContext, e interface{}) (ret interface{}) + type WSConn struct + func NewWSConn(conn *websocket.Conn) (*WSConn, error) + func (c *WSConn) Close() error + func (c *WSConn) LocalAddr() net.Addr + func (c *WSConn) Read(b []byte) (int, error) + func (c *WSConn) RemoteAddr() net.Addr + func (c *WSConn) SetDeadline(t time.Time) error + func (c *WSConn) SetReadDeadline(t time.Time) error + func (c *WSConn) SetWriteDeadline(t time.Time) error + func (c *WSConn) Write(b []byte) (int, error) + type WriteEvent struct + func NewWriteEvent(data []byte, isClose bool) (this *WriteEvent)