Documentation
¶
Index ¶
- func NewDefaultPipeline(channel Channel) *defaultPipeline
- type Channel
- type DefaultChannel
- func (c *DefaultChannel) Close() error
- func (c *DefaultChannel) Flush() error
- func (c *DefaultChannel) Id() channelid.ChannelId
- func (c *DefaultChannel) LocalAddr() net.Addr
- func (c *DefaultChannel) Pipeline() Pipeline
- func (c *DefaultChannel) Read(p []byte) (n int, err error)
- func (c *DefaultChannel) RemoteAddr() net.Addr
- func (c *DefaultChannel) Write(p []byte) (n int, err error)
- type Handler
- type HandlerContext
- type InboundHandler
- type InboundInvoker
- type OutboundHandler
- type OutboundInvoker
- type Pipeline
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultPipeline ¶
func NewDefaultPipeline(channel Channel) *defaultPipeline
Types ¶
type DefaultChannel ¶
type DefaultChannel struct {
util.DefaultAttributeMap
// contains filtered or unexported fields
}
func NewDefaultChannel ¶
func NewDefaultChannel(conn net.Conn) *DefaultChannel
func (*DefaultChannel) Close ¶
func (c *DefaultChannel) Close() error
func (*DefaultChannel) Flush ¶
func (c *DefaultChannel) Flush() error
flush output, only working with buffered writer
func (*DefaultChannel) Id ¶
func (c *DefaultChannel) Id() channelid.ChannelId
func (*DefaultChannel) LocalAddr ¶
func (c *DefaultChannel) LocalAddr() net.Addr
func (*DefaultChannel) Pipeline ¶
func (c *DefaultChannel) Pipeline() Pipeline
func (*DefaultChannel) RemoteAddr ¶
func (c *DefaultChannel) RemoteAddr() net.Addr
type Handler ¶
type Handler interface {
OnError(c HandlerContext, err error)
}
type HandlerContext ¶
type HandlerContext interface {
InboundInvoker
OutboundInvoker
Channel() Channel
Name() string
Handler() Handler
Pipeline() Pipeline
TransferChannelRead(name string, msg interface{})
}
type InboundHandler ¶
type InboundHandler interface {
Handler
ChannelActive(c HandlerContext)
ChannelInActive(c HandlerContext)
ChannelRead(c HandlerContext, msg interface{})
}
type InboundInvoker ¶
type InboundInvoker interface {
ChannelActive()
ChannelInActive()
ChannelRead(msg interface{})
OnError(err error)
}
type OutboundHandler ¶
type OutboundHandler interface {
Handler
Write(c HandlerContext, msg interface{}) error
Flush(c HandlerContext) error
}
type OutboundInvoker ¶
type Pipeline ¶
type Pipeline interface {
InboundInvoker
OutboundInvoker
Channel() Channel
AddLast(name string, handler Handler)
AddFirst(name string, handler Handler)
}
Click to show internal directories.
Click to hide internal directories.