Documentation ¶
Index ¶
- Constants
- Variables
- func GetParamBoolDefault(ch Channel, key ParamKey, defaultValue bool) bool
- func GetParamInt64Default(ch Channel, key ParamKey, defaultValue int64) int64
- func GetParamIntDefault(ch Channel, key ParamKey, defaultValue int) int
- func GetParamStringDefault(ch Channel, key ParamKey, defaultValue string) string
- func ValueSetFieldVal(target *reflect.Value, field string, val interface{}) bool
- type Bootstrap
- type BootstrapChannelPostInit
- type BootstrapChannelPreInit
- type ByteToMessageDecoder
- type Channel
- type Conn
- type DefaultBootstrap
- func (d *DefaultBootstrap) ChannelType(ch Channel) Bootstrap
- func (d *DefaultBootstrap) Connect(localAddr net.Addr, remoteAddr net.Addr) Future
- func (d *DefaultBootstrap) Handler(handler Handler) Bootstrap
- func (d *DefaultBootstrap) Params() *Params
- func (d *DefaultBootstrap) SetParams(key ParamKey, value interface{}) Bootstrap
- type DefaultChannel
- func (c *DefaultChannel) Bind(localAddr net.Addr) Future
- func (c *DefaultChannel) Close() Future
- func (c *DefaultChannel) CloseFuture() Future
- func (c *DefaultChannel) Connect(localAddr net.Addr, remoteAddr net.Addr) Future
- func (c *DefaultChannel) Deregister() Future
- func (c *DefaultChannel) Disconnect() Future
- func (c *DefaultChannel) FireRead(obj interface{}) Channel
- func (c *DefaultChannel) FireReadCompleted() Channel
- func (c *DefaultChannel) ID() string
- func (c *DefaultChannel) Init() Channel
- func (c *DefaultChannel) IsActive() bool
- func (c *DefaultChannel) LocalAddr() net.Addr
- func (c *DefaultChannel) Param(key ParamKey) interface{}
- func (c *DefaultChannel) Params() *Params
- func (c *DefaultChannel) Parent() ServerChannel
- func (c *DefaultChannel) Pipeline() Pipeline
- func (c *DefaultChannel) Read() Channel
- func (c *DefaultChannel) SetParam(key ParamKey, value interface{})
- func (c *DefaultChannel) UnsafeConnect(localAddr net.Addr, remoteAddr net.Addr) error
- func (c *DefaultChannel) UnsafeDisconnect() error
- func (c *DefaultChannel) UnsafeIsAutoRead() bool
- func (c *DefaultChannel) UnsafeRead() (interface{}, error)
- func (c *DefaultChannel) UnsafeWrite(obj interface{}) error
- func (c *DefaultChannel) Write(obj interface{}) Future
- type DefaultConn
- func (c *DefaultConn) Close() error
- func (c *DefaultConn) Conn() net.Conn
- func (c *DefaultConn) IsActive() bool
- func (c *DefaultConn) LocalAddr() net.Addr
- func (c *DefaultConn) Read(b []byte) (n int, err error)
- func (c *DefaultConn) RemoteAddr() net.Addr
- func (c *DefaultConn) SetDeadline(t time.Time) error
- func (c *DefaultConn) SetReadDeadline(t time.Time) error
- func (c *DefaultConn) SetWriteDeadline(t time.Time) error
- func (c *DefaultConn) Write(b []byte) (n int, err error)
- type DefaultFuture
- type DefaultHandler
- func (h *DefaultHandler) Active(ctx HandlerContext)
- func (h *DefaultHandler) Added(ctx HandlerContext)
- func (h *DefaultHandler) Bind(ctx HandlerContext, localAddr net.Addr, future Future)
- func (h *DefaultHandler) Close(ctx HandlerContext, future Future)
- func (h *DefaultHandler) Connect(ctx HandlerContext, localAddr net.Addr, remoteAddr net.Addr, future Future)
- func (h *DefaultHandler) Deregister(ctx HandlerContext, future Future)
- func (h *DefaultHandler) Disconnect(ctx HandlerContext, future Future)
- func (h *DefaultHandler) ErrorCaught(ctx HandlerContext, err error)
- func (h *DefaultHandler) Inactive(ctx HandlerContext)
- func (h *DefaultHandler) Read(ctx HandlerContext, obj interface{})
- func (h *DefaultHandler) ReadCompleted(ctx HandlerContext)
- func (h *DefaultHandler) Registered(ctx HandlerContext)
- func (h *DefaultHandler) Removed(ctx HandlerContext)
- func (h *DefaultHandler) Unregistered(ctx HandlerContext)
- func (h *DefaultHandler) Write(ctx HandlerContext, obj interface{}, future Future)
- type DefaultHandlerContext
- func (d *DefaultHandlerContext) Bind(localAddr net.Addr, future Future) Future
- func (d *DefaultHandlerContext) Channel() Channel
- func (d *DefaultHandlerContext) Close(future Future) Future
- func (d *DefaultHandlerContext) Connect(localAddr net.Addr, remoteAddr net.Addr, future Future) Future
- func (d *DefaultHandlerContext) Deregister(future Future) Future
- func (d *DefaultHandlerContext) Disconnect(future Future) Future
- func (d *DefaultHandlerContext) FireActive() HandlerContext
- func (d *DefaultHandlerContext) FireErrorCaught(err error) HandlerContext
- func (d *DefaultHandlerContext) FireInactive() HandlerContext
- func (d *DefaultHandlerContext) FireRead(obj interface{}) HandlerContext
- func (d *DefaultHandlerContext) FireReadCompleted() HandlerContext
- func (d *DefaultHandlerContext) FireRegistered() HandlerContext
- func (d *DefaultHandlerContext) FireUnregistered() HandlerContext
- func (d *DefaultHandlerContext) Name() string
- func (d *DefaultHandlerContext) Write(obj interface{}, future Future) Future
- type DefaultInitializer
- type DefaultNetChannel
- func (c *DefaultNetChannel) Conn() Conn
- func (c *DefaultNetChannel) Init() Channel
- func (c *DefaultNetChannel) IsActive() bool
- func (c *DefaultNetChannel) LocalAddr() net.Addr
- func (c *DefaultNetChannel) RemoteAddr() net.Addr
- func (c *DefaultNetChannel) SetConn(conn net.Conn)
- func (c *DefaultNetChannel) UnsafeConnect(localAddr net.Addr, remoteAddr net.Addr) error
- func (c *DefaultNetChannel) UnsafeDisconnect() error
- func (c *DefaultNetChannel) UnsafeRead() (interface{}, error)
- func (c *DefaultNetChannel) UnsafeWrite(obj interface{}) error
- type DefaultNetServerChannel
- func (c *DefaultNetServerChannel) Conn() Conn
- func (c *DefaultNetServerChannel) LocalAddr() net.Addr
- func (c *DefaultNetServerChannel) RemoteAddr() net.Addr
- func (c *DefaultNetServerChannel) UnsafeAccept() (Channel, Future)
- func (c *DefaultNetServerChannel) UnsafeBind(localAddr net.Addr) error
- func (c *DefaultNetServerChannel) UnsafeClose() error
- type DefaultPipeline
- func (p *DefaultPipeline) AddBefore(target string, name string, elem Handler) Pipeline
- func (p *DefaultPipeline) AddLast(name string, elem Handler) Pipeline
- func (p *DefaultPipeline) Bind(localAddr net.Addr) Future
- func (p *DefaultPipeline) Channel() Channel
- func (p *DefaultPipeline) Clear() Pipeline
- func (p *DefaultPipeline) Close() Future
- func (p *DefaultPipeline) Connect(localAddr net.Addr, remoteAddr net.Addr) Future
- func (p *DefaultPipeline) Deregister() Future
- func (p *DefaultPipeline) Disconnect() Future
- func (p *DefaultPipeline) NewFuture() Future
- func (p *DefaultPipeline) Param(key ParamKey) interface{}
- func (p *DefaultPipeline) Params() *Params
- func (p *DefaultPipeline) Read() Pipeline
- func (p *DefaultPipeline) Remove(elem Handler) Pipeline
- func (p *DefaultPipeline) RemoveByName(name string) Pipeline
- func (p *DefaultPipeline) RemoveFirst() Pipeline
- func (p *DefaultPipeline) SetChannel(channel Channel)
- func (p *DefaultPipeline) SetParam(key ParamKey, value interface{}) Pipeline
- func (p *DefaultPipeline) Write(obj interface{}) Future
- type DefaultServerBootstrap
- type DefaultServerChannel
- func (c *DefaultServerChannel) ChildParams() *Params
- func (c *DefaultServerChannel) DeriveChildChannel(child Channel, parent ServerChannel) Channel
- func (c *DefaultServerChannel) DeriveNetChildChannel(child NetChannel, parent NetServerChannel, conn net.Conn) Channel
- func (c *DefaultServerChannel) UnsafeAccept() (Channel, Future)
- func (c *DefaultServerChannel) UnsafeBind(localAddr net.Addr) error
- func (c *DefaultServerChannel) UnsafeClose() error
- func (c *DefaultServerChannel) UnsafeIsAutoRead() bool
- type DefaultUnsafe
- func (u *DefaultUnsafe) Bind(localAddr net.Addr, future Future)
- func (u *DefaultUnsafe) Close(future Future)
- func (u *DefaultUnsafe) Connect(localAddr net.Addr, remoteAddr net.Addr, future Future)
- func (u *DefaultUnsafe) Disconnect(future Future)
- func (u *DefaultUnsafe) Read()
- func (u *DefaultUnsafe) Write(obj interface{}, future Future)
- type Future
- type Handler
- type HandlerContext
- type IndicateHandlerInbound
- func (h *IndicateHandlerInbound) Active(ctx HandlerContext)
- func (h *IndicateHandlerInbound) Deregister(ctx HandlerContext, future Future)
- func (h *IndicateHandlerInbound) Inactive(ctx HandlerContext)
- func (h *IndicateHandlerInbound) Read(ctx HandlerContext, obj interface{})
- func (h *IndicateHandlerInbound) ReadCompleted(ctx HandlerContext)
- func (h *IndicateHandlerInbound) Registered(ctx HandlerContext)
- func (h *IndicateHandlerInbound) Unregistered(ctx HandlerContext)
- type IndicateHandlerOutbound
- func (h *IndicateHandlerOutbound) Bind(ctx HandlerContext, localAddr net.Addr, future Future)
- func (h *IndicateHandlerOutbound) Close(ctx HandlerContext, future Future)
- func (h *IndicateHandlerOutbound) Connect(ctx HandlerContext, localAddr net.Addr, remoteAddr net.Addr, future Future)
- func (h *IndicateHandlerOutbound) Disconnect(ctx HandlerContext, future Future)
- func (h *IndicateHandlerOutbound) Write(ctx HandlerContext, obj interface{}, future Future)
- type LogStruct
- type MessageDecoder
- type MessageEncoder
- type MessageToByteEncoder
- type NetChannel
- type NetChannelSetConn
- type NetServerChannel
- type NetStatusInbound
- type NetStatusOutbound
- func (h *NetStatusOutbound) Bind(ctx HandlerContext, localAddr net.Addr, future Future)
- func (h *NetStatusOutbound) Close(ctx HandlerContext, future Future)
- func (h *NetStatusOutbound) Connect(ctx HandlerContext, localAddr net.Addr, remoteAddr net.Addr, future Future)
- func (h *NetStatusOutbound) Disconnect(ctx HandlerContext, future Future)
- type ParamKey
- type Params
- func (p *Params) Delete(key ParamKey)
- func (p *Params) Load(key ParamKey) (value interface{}, ok bool)
- func (p *Params) LoadOrStore(key ParamKey, value interface{}) (actual interface{}, loaded bool)
- func (p *Params) Range(f func(key ParamKey, value interface{}) bool)
- func (p *Params) Store(key ParamKey, value interface{})
- type Pipeline
- type PipelineSetChannel
- type ReplayDecoder
- type ReplayState
- type ServerBootstrap
- type ServerChannel
- type Unsafe
- type UnsafeAccept
- type UnsafeBind
- type UnsafeClose
- type UnsafeConnect
- type UnsafeDisconnect
- type UnsafeRead
- type UnsafeWrite
Constants ¶
View Source
const ParamReadBufferSize = ParamKey("read_buffer_size")
View Source
const ParamReadTimeout = ParamKey("read_timeout")
View Source
const ParamWriteTimeout = ParamKey("write_timeout")
View Source
const PipelineHeadHandlerContextName = "DEFAULT_HEAD_HANDLER_CONTEXT"
View Source
const PipelineTailHandlerContextName = "DEFAULT_TAIL_HANDLER_CONTEXT"
Variables ¶
View Source
var ErrNilObject = fmt.Errorf("nil object")
View Source
var ErrNotActive = errors.Errorf("channel not active")
View Source
var ErrReadError = fmt.Errorf("read error")
View Source
var ErrSkip = fmt.Errorf("skip")
View Source
var ErrUnknownObjectType = fmt.Errorf("unknown object type")
View Source
var IDEncoder = base62.FlipEncoding
Functions ¶
func GetParamBoolDefault ¶
func GetParamInt64Default ¶
func GetParamStringDefault ¶
Types ¶
type Bootstrap ¶
type Bootstrap interface { Handler(handler Handler) Bootstrap ChannelType(ch Channel) Bootstrap Connect(localAddr net.Addr, remoteAddr net.Addr) Future SetParams(key ParamKey, value interface{}) Bootstrap Params() *Params }
func NewBootstrap ¶
func NewBootstrap() Bootstrap
type BootstrapChannelPostInit ¶
type BootstrapChannelPostInit interface {
BootstrapPostInit()
}
type BootstrapChannelPreInit ¶
type BootstrapChannelPreInit interface {
BootstrapPreInit()
}
type ByteToMessageDecoder ¶
type ByteToMessageDecoder struct { DefaultHandler Decode func(ctx HandlerContext, in buf.ByteBuf, out *utils.Queue) }
func (*ByteToMessageDecoder) Added ¶
func (h *ByteToMessageDecoder) Added(ctx HandlerContext)
func (*ByteToMessageDecoder) Read ¶
func (h *ByteToMessageDecoder) Read(ctx HandlerContext, obj interface{})
type Channel ¶
type Channel interface { ID() string Init() Channel Pipeline() Pipeline CloseFuture() Future Bind(localAddr net.Addr) Future Close() Future Connect(localAddr net.Addr, remoteAddr net.Addr) Future Disconnect() Future Deregister() Future Read() Channel FireRead(obj interface{}) Channel FireReadCompleted() Channel Write(obj interface{}) Future IsActive() bool SetParam(key ParamKey, value interface{}) Param(key ParamKey) interface{} Params() *Params Parent() ServerChannel LocalAddr() net.Addr // contains filtered or unexported methods }
type DefaultBootstrap ¶
type DefaultBootstrap struct {
// contains filtered or unexported fields
}
func (*DefaultBootstrap) ChannelType ¶
func (d *DefaultBootstrap) ChannelType(ch Channel) Bootstrap
func (*DefaultBootstrap) Handler ¶
func (d *DefaultBootstrap) Handler(handler Handler) Bootstrap
func (*DefaultBootstrap) Params ¶
func (d *DefaultBootstrap) Params() *Params
func (*DefaultBootstrap) SetParams ¶
func (d *DefaultBootstrap) SetParams(key ParamKey, value interface{}) Bootstrap
type DefaultChannel ¶
type DefaultChannel struct { Name string // contains filtered or unexported fields }
func (*DefaultChannel) Close ¶
func (c *DefaultChannel) Close() Future
func (*DefaultChannel) CloseFuture ¶
func (c *DefaultChannel) CloseFuture() Future
func (*DefaultChannel) Deregister ¶
func (c *DefaultChannel) Deregister() Future
func (*DefaultChannel) Disconnect ¶
func (c *DefaultChannel) Disconnect() Future
func (*DefaultChannel) FireRead ¶
func (c *DefaultChannel) FireRead(obj interface{}) Channel
func (*DefaultChannel) FireReadCompleted ¶
func (c *DefaultChannel) FireReadCompleted() Channel
func (*DefaultChannel) ID ¶
func (c *DefaultChannel) ID() string
func (*DefaultChannel) Init ¶
func (c *DefaultChannel) Init() Channel
func (*DefaultChannel) IsActive ¶
func (c *DefaultChannel) IsActive() bool
func (*DefaultChannel) LocalAddr ¶
func (c *DefaultChannel) LocalAddr() net.Addr
func (*DefaultChannel) Param ¶
func (c *DefaultChannel) Param(key ParamKey) interface{}
func (*DefaultChannel) Params ¶
func (c *DefaultChannel) Params() *Params
func (*DefaultChannel) Parent ¶
func (c *DefaultChannel) Parent() ServerChannel
func (*DefaultChannel) Pipeline ¶
func (c *DefaultChannel) Pipeline() Pipeline
func (*DefaultChannel) Read ¶
func (c *DefaultChannel) Read() Channel
func (*DefaultChannel) SetParam ¶
func (c *DefaultChannel) SetParam(key ParamKey, value interface{})
func (*DefaultChannel) UnsafeConnect ¶
func (*DefaultChannel) UnsafeDisconnect ¶
func (c *DefaultChannel) UnsafeDisconnect() error
func (*DefaultChannel) UnsafeIsAutoRead ¶
func (c *DefaultChannel) UnsafeIsAutoRead() bool
func (*DefaultChannel) UnsafeRead ¶
func (c *DefaultChannel) UnsafeRead() (interface{}, error)
func (*DefaultChannel) UnsafeWrite ¶
func (c *DefaultChannel) UnsafeWrite(obj interface{}) error
func (*DefaultChannel) Write ¶
func (c *DefaultChannel) Write(obj interface{}) Future
type DefaultConn ¶
type DefaultConn struct {
// contains filtered or unexported fields
}
func (*DefaultConn) Close ¶
func (c *DefaultConn) Close() error
func (*DefaultConn) Conn ¶
func (c *DefaultConn) Conn() net.Conn
func (*DefaultConn) IsActive ¶
func (c *DefaultConn) IsActive() bool
func (*DefaultConn) LocalAddr ¶
func (c *DefaultConn) LocalAddr() net.Addr
func (*DefaultConn) RemoteAddr ¶
func (c *DefaultConn) RemoteAddr() net.Addr
func (*DefaultConn) SetDeadline ¶
func (c *DefaultConn) SetDeadline(t time.Time) error
func (*DefaultConn) SetReadDeadline ¶
func (c *DefaultConn) SetReadDeadline(t time.Time) error
func (*DefaultConn) SetWriteDeadline ¶
func (c *DefaultConn) SetWriteDeadline(t time.Time) error
type DefaultFuture ¶
type DefaultFuture struct { concurrent.Future // contains filtered or unexported fields }
func (*DefaultFuture) AddListener ¶
func (d *DefaultFuture) AddListener(listener concurrent.FutureListener) concurrent.Future
func (*DefaultFuture) Channel ¶
func (d *DefaultFuture) Channel() Channel
func (*DefaultFuture) Completable ¶
func (d *DefaultFuture) Completable() concurrent.CompletableFuture
func (*DefaultFuture) Sync ¶
func (d *DefaultFuture) Sync() Future
type DefaultHandler ¶
type DefaultHandler struct { }
func (*DefaultHandler) Active ¶
func (h *DefaultHandler) Active(ctx HandlerContext)
func (*DefaultHandler) Added ¶
func (h *DefaultHandler) Added(ctx HandlerContext)
func (*DefaultHandler) Bind ¶
func (h *DefaultHandler) Bind(ctx HandlerContext, localAddr net.Addr, future Future)
func (*DefaultHandler) Close ¶
func (h *DefaultHandler) Close(ctx HandlerContext, future Future)
func (*DefaultHandler) Connect ¶
func (h *DefaultHandler) Connect(ctx HandlerContext, localAddr net.Addr, remoteAddr net.Addr, future Future)
func (*DefaultHandler) Deregister ¶
func (h *DefaultHandler) Deregister(ctx HandlerContext, future Future)
func (*DefaultHandler) Disconnect ¶
func (h *DefaultHandler) Disconnect(ctx HandlerContext, future Future)
func (*DefaultHandler) ErrorCaught ¶
func (h *DefaultHandler) ErrorCaught(ctx HandlerContext, err error)
func (*DefaultHandler) Inactive ¶
func (h *DefaultHandler) Inactive(ctx HandlerContext)
func (*DefaultHandler) Read ¶
func (h *DefaultHandler) Read(ctx HandlerContext, obj interface{})
func (*DefaultHandler) ReadCompleted ¶
func (h *DefaultHandler) ReadCompleted(ctx HandlerContext)
func (*DefaultHandler) Registered ¶
func (h *DefaultHandler) Registered(ctx HandlerContext)
func (*DefaultHandler) Removed ¶
func (h *DefaultHandler) Removed(ctx HandlerContext)
func (*DefaultHandler) Unregistered ¶
func (h *DefaultHandler) Unregistered(ctx HandlerContext)
func (*DefaultHandler) Write ¶
func (h *DefaultHandler) Write(ctx HandlerContext, obj interface{}, future Future)
type DefaultHandlerContext ¶
type DefaultHandlerContext struct {
// contains filtered or unexported fields
}
func NewHandlerContext ¶
func NewHandlerContext() *DefaultHandlerContext
func (*DefaultHandlerContext) Bind ¶
func (d *DefaultHandlerContext) Bind(localAddr net.Addr, future Future) Future
func (*DefaultHandlerContext) Channel ¶
func (d *DefaultHandlerContext) Channel() Channel
func (*DefaultHandlerContext) Close ¶
func (d *DefaultHandlerContext) Close(future Future) Future
func (*DefaultHandlerContext) Deregister ¶
func (d *DefaultHandlerContext) Deregister(future Future) Future
func (*DefaultHandlerContext) Disconnect ¶
func (d *DefaultHandlerContext) Disconnect(future Future) Future
func (*DefaultHandlerContext) FireActive ¶
func (d *DefaultHandlerContext) FireActive() HandlerContext
func (*DefaultHandlerContext) FireErrorCaught ¶
func (d *DefaultHandlerContext) FireErrorCaught(err error) HandlerContext
func (*DefaultHandlerContext) FireInactive ¶
func (d *DefaultHandlerContext) FireInactive() HandlerContext
func (*DefaultHandlerContext) FireRead ¶
func (d *DefaultHandlerContext) FireRead(obj interface{}) HandlerContext
func (*DefaultHandlerContext) FireReadCompleted ¶
func (d *DefaultHandlerContext) FireReadCompleted() HandlerContext
func (*DefaultHandlerContext) FireRegistered ¶
func (d *DefaultHandlerContext) FireRegistered() HandlerContext
func (*DefaultHandlerContext) FireUnregistered ¶
func (d *DefaultHandlerContext) FireUnregistered() HandlerContext
func (*DefaultHandlerContext) Name ¶
func (d *DefaultHandlerContext) Name() string
func (*DefaultHandlerContext) Write ¶
func (d *DefaultHandlerContext) Write(obj interface{}, future Future) Future
type DefaultInitializer ¶
type DefaultInitializer struct { DefaultHandler // contains filtered or unexported fields }
func NewInitializer ¶
func NewInitializer(f func(ch Channel)) *DefaultInitializer
func (*DefaultInitializer) Added ¶
func (i *DefaultInitializer) Added(ctx HandlerContext)
type DefaultNetChannel ¶
type DefaultNetChannel struct { DefaultChannel BufferSize int ReadTimeout time.Duration WriteTimeout time.Duration // contains filtered or unexported fields }
func (*DefaultNetChannel) Conn ¶
func (c *DefaultNetChannel) Conn() Conn
func (*DefaultNetChannel) Init ¶
func (c *DefaultNetChannel) Init() Channel
func (*DefaultNetChannel) IsActive ¶
func (c *DefaultNetChannel) IsActive() bool
func (*DefaultNetChannel) LocalAddr ¶
func (c *DefaultNetChannel) LocalAddr() net.Addr
func (*DefaultNetChannel) RemoteAddr ¶
func (c *DefaultNetChannel) RemoteAddr() net.Addr
func (*DefaultNetChannel) SetConn ¶
func (c *DefaultNetChannel) SetConn(conn net.Conn)
func (*DefaultNetChannel) UnsafeConnect ¶
func (*DefaultNetChannel) UnsafeDisconnect ¶
func (c *DefaultNetChannel) UnsafeDisconnect() error
func (*DefaultNetChannel) UnsafeRead ¶
func (c *DefaultNetChannel) UnsafeRead() (interface{}, error)
func (*DefaultNetChannel) UnsafeWrite ¶
func (c *DefaultNetChannel) UnsafeWrite(obj interface{}) error
type DefaultNetServerChannel ¶
type DefaultNetServerChannel struct {
DefaultServerChannel
}
func (*DefaultNetServerChannel) Conn ¶
func (c *DefaultNetServerChannel) Conn() Conn
func (*DefaultNetServerChannel) LocalAddr ¶
func (c *DefaultNetServerChannel) LocalAddr() net.Addr
func (*DefaultNetServerChannel) RemoteAddr ¶
func (c *DefaultNetServerChannel) RemoteAddr() net.Addr
func (*DefaultNetServerChannel) UnsafeAccept ¶
func (c *DefaultNetServerChannel) UnsafeAccept() (Channel, Future)
func (*DefaultNetServerChannel) UnsafeBind ¶
func (c *DefaultNetServerChannel) UnsafeBind(localAddr net.Addr) error
func (*DefaultNetServerChannel) UnsafeClose ¶
func (c *DefaultNetServerChannel) UnsafeClose() error
type DefaultPipeline ¶
type DefaultPipeline struct {
// contains filtered or unexported fields
}
func (*DefaultPipeline) AddBefore ¶
func (p *DefaultPipeline) AddBefore(target string, name string, elem Handler) Pipeline
func (*DefaultPipeline) AddLast ¶
func (p *DefaultPipeline) AddLast(name string, elem Handler) Pipeline
func (*DefaultPipeline) Channel ¶
func (p *DefaultPipeline) Channel() Channel
func (*DefaultPipeline) Clear ¶
func (p *DefaultPipeline) Clear() Pipeline
func (*DefaultPipeline) Close ¶
func (p *DefaultPipeline) Close() Future
func (*DefaultPipeline) Deregister ¶
func (p *DefaultPipeline) Deregister() Future
func (*DefaultPipeline) Disconnect ¶
func (p *DefaultPipeline) Disconnect() Future
func (*DefaultPipeline) NewFuture ¶
func (p *DefaultPipeline) NewFuture() Future
func (*DefaultPipeline) Param ¶
func (p *DefaultPipeline) Param(key ParamKey) interface{}
func (*DefaultPipeline) Params ¶
func (p *DefaultPipeline) Params() *Params
func (*DefaultPipeline) Read ¶
func (p *DefaultPipeline) Read() Pipeline
func (*DefaultPipeline) Remove ¶
func (p *DefaultPipeline) Remove(elem Handler) Pipeline
func (*DefaultPipeline) RemoveByName ¶
func (p *DefaultPipeline) RemoveByName(name string) Pipeline
func (*DefaultPipeline) RemoveFirst ¶
func (p *DefaultPipeline) RemoveFirst() Pipeline
func (*DefaultPipeline) SetChannel ¶
func (p *DefaultPipeline) SetChannel(channel Channel)
func (*DefaultPipeline) SetParam ¶
func (p *DefaultPipeline) SetParam(key ParamKey, value interface{}) Pipeline
func (*DefaultPipeline) Write ¶
func (p *DefaultPipeline) Write(obj interface{}) Future
type DefaultServerBootstrap ¶
type DefaultServerBootstrap struct { DefaultBootstrap // contains filtered or unexported fields }
func (*DefaultServerBootstrap) Bind ¶
func (d *DefaultServerBootstrap) Bind(localAddr net.Addr) Future
func (*DefaultServerBootstrap) ChildHandler ¶
func (d *DefaultServerBootstrap) ChildHandler(handler Handler) ServerBootstrap
func (*DefaultServerBootstrap) ChildParams ¶
func (d *DefaultServerBootstrap) ChildParams() *Params
func (*DefaultServerBootstrap) SetChildParams ¶
func (d *DefaultServerBootstrap) SetChildParams(key ParamKey, value interface{}) ServerBootstrap
type DefaultServerChannel ¶
type DefaultServerChannel struct { DefaultChannel // contains filtered or unexported fields }
func (*DefaultServerChannel) ChildParams ¶
func (c *DefaultServerChannel) ChildParams() *Params
func (*DefaultServerChannel) DeriveChildChannel ¶
func (c *DefaultServerChannel) DeriveChildChannel(child Channel, parent ServerChannel) Channel
func (*DefaultServerChannel) DeriveNetChildChannel ¶
func (c *DefaultServerChannel) DeriveNetChildChannel(child NetChannel, parent NetServerChannel, conn net.Conn) Channel
func (*DefaultServerChannel) UnsafeAccept ¶
func (c *DefaultServerChannel) UnsafeAccept() (Channel, Future)
func (*DefaultServerChannel) UnsafeBind ¶
func (c *DefaultServerChannel) UnsafeBind(localAddr net.Addr) error
func (*DefaultServerChannel) UnsafeClose ¶
func (c *DefaultServerChannel) UnsafeClose() error
func (*DefaultServerChannel) UnsafeIsAutoRead ¶
func (c *DefaultServerChannel) UnsafeIsAutoRead() bool
type DefaultUnsafe ¶
type DefaultUnsafe struct {
// contains filtered or unexported fields
}
func (*DefaultUnsafe) Close ¶
func (u *DefaultUnsafe) Close(future Future)
func (*DefaultUnsafe) Disconnect ¶
func (u *DefaultUnsafe) Disconnect(future Future)
func (*DefaultUnsafe) Read ¶
func (u *DefaultUnsafe) Read()
func (*DefaultUnsafe) Write ¶
func (u *DefaultUnsafe) Write(obj interface{}, future Future)
type Future ¶
type Future interface { concurrent.Future Sync() Future Completable() concurrent.CompletableFuture Channel() Channel // contains filtered or unexported methods }
type Handler ¶
type Handler interface { Added(ctx HandlerContext) Removed(ctx HandlerContext) Registered(ctx HandlerContext) Unregistered(ctx HandlerContext) Active(ctx HandlerContext) Inactive(ctx HandlerContext) Read(ctx HandlerContext, obj interface{}) ReadCompleted(ctx HandlerContext) Write(ctx HandlerContext, obj interface{}, future Future) Bind(ctx HandlerContext, localAddr net.Addr, future Future) Close(ctx HandlerContext, future Future) Connect(ctx HandlerContext, localAddr net.Addr, remoteAddr net.Addr, future Future) Disconnect(ctx HandlerContext, future Future) Deregister(ctx HandlerContext, future Future) ErrorCaught(ctx HandlerContext, err error) // contains filtered or unexported methods }
func NewRWHandler ¶
func NewRWHandler(r func(ctx HandlerContext, obj interface{}), w func(ctx HandlerContext, obj interface{}, future Future)) Handler
type HandlerContext ¶
type HandlerContext interface { Name() string Channel() Channel FireRegistered() HandlerContext FireUnregistered() HandlerContext FireActive() HandlerContext FireInactive() HandlerContext FireRead(obj interface{}) HandlerContext FireReadCompleted() HandlerContext FireErrorCaught(err error) HandlerContext Write(obj interface{}, future Future) Future Bind(localAddr net.Addr, future Future) Future Close(future Future) Future Connect(localAddr net.Addr, remoteAddr net.Addr, future Future) Future Disconnect(future Future) Future Deregister(future Future) Future // contains filtered or unexported methods }
type IndicateHandlerInbound ¶
type IndicateHandlerInbound struct {
DefaultHandler
}
func (*IndicateHandlerInbound) Active ¶
func (h *IndicateHandlerInbound) Active(ctx HandlerContext)
func (*IndicateHandlerInbound) Deregister ¶
func (h *IndicateHandlerInbound) Deregister(ctx HandlerContext, future Future)
func (*IndicateHandlerInbound) Inactive ¶
func (h *IndicateHandlerInbound) Inactive(ctx HandlerContext)
func (*IndicateHandlerInbound) Read ¶
func (h *IndicateHandlerInbound) Read(ctx HandlerContext, obj interface{})
func (*IndicateHandlerInbound) ReadCompleted ¶
func (h *IndicateHandlerInbound) ReadCompleted(ctx HandlerContext)
func (*IndicateHandlerInbound) Registered ¶
func (h *IndicateHandlerInbound) Registered(ctx HandlerContext)
func (*IndicateHandlerInbound) Unregistered ¶
func (h *IndicateHandlerInbound) Unregistered(ctx HandlerContext)
type IndicateHandlerOutbound ¶
type IndicateHandlerOutbound struct {
DefaultHandler
}
func (*IndicateHandlerOutbound) Bind ¶
func (h *IndicateHandlerOutbound) Bind(ctx HandlerContext, localAddr net.Addr, future Future)
func (*IndicateHandlerOutbound) Close ¶
func (h *IndicateHandlerOutbound) Close(ctx HandlerContext, future Future)
func (*IndicateHandlerOutbound) Connect ¶
func (h *IndicateHandlerOutbound) Connect(ctx HandlerContext, localAddr net.Addr, remoteAddr net.Addr, future Future)
func (*IndicateHandlerOutbound) Disconnect ¶
func (h *IndicateHandlerOutbound) Disconnect(ctx HandlerContext, future Future)
func (*IndicateHandlerOutbound) Write ¶
func (h *IndicateHandlerOutbound) Write(ctx HandlerContext, obj interface{}, future Future)
type MessageDecoder ¶
type MessageDecoder interface {
Decode(ctx HandlerContext, in buf.ByteBuf, out *utils.Queue)
}
type MessageEncoder ¶
type MessageEncoder interface {
Encode(ctx HandlerContext, msg interface{}, out buf.ByteBuf)
}
type MessageToByteEncoder ¶
type MessageToByteEncoder struct { DefaultHandler Encode func(ctx HandlerContext, msg interface{}, out buf.ByteBuf) }
func (*MessageToByteEncoder) Added ¶
func (h *MessageToByteEncoder) Added(ctx HandlerContext)
func (*MessageToByteEncoder) Write ¶
func (h *MessageToByteEncoder) Write(ctx HandlerContext, obj interface{}, future Future)
type NetChannel ¶
type NetChannelSetConn ¶
type NetServerChannel ¶
type NetServerChannel interface { ServerChannel }
type NetStatusInbound ¶
type NetStatusInbound struct { DefaultHandler LogLevel kklogger.Level }
func (*NetStatusInbound) Active ¶
func (h *NetStatusInbound) Active(ctx HandlerContext)
func (*NetStatusInbound) Inactive ¶
func (h *NetStatusInbound) Inactive(ctx HandlerContext)
type NetStatusOutbound ¶
type NetStatusOutbound struct { DefaultHandler LogLevel kklogger.Level }
func (*NetStatusOutbound) Bind ¶
func (h *NetStatusOutbound) Bind(ctx HandlerContext, localAddr net.Addr, future Future)
func (*NetStatusOutbound) Close ¶
func (h *NetStatusOutbound) Close(ctx HandlerContext, future Future)
func (*NetStatusOutbound) Connect ¶
func (h *NetStatusOutbound) Connect(ctx HandlerContext, localAddr net.Addr, remoteAddr net.Addr, future Future)
func (*NetStatusOutbound) Disconnect ¶
func (h *NetStatusOutbound) Disconnect(ctx HandlerContext, future Future)
type Params ¶
func (*Params) LoadOrStore ¶
type Pipeline ¶
type Pipeline interface { AddLast(name string, elem Handler) Pipeline AddBefore(target string, name string, elem Handler) Pipeline RemoveFirst() Pipeline Remove(elem Handler) Pipeline RemoveByName(name string) Pipeline Clear() Pipeline Channel() Channel Param(key ParamKey) interface{} SetParam(key ParamKey, value interface{}) Pipeline Params() *Params Read() Pipeline Write(obj interface{}) Future Bind(localAddr net.Addr) Future Close() Future Connect(localAddr net.Addr, remoteAddr net.Addr) Future Disconnect() Future Deregister() Future NewFuture() Future // contains filtered or unexported methods }
type PipelineSetChannel ¶
type PipelineSetChannel interface {
SetChannel(channel Channel)
}
type ReplayDecoder ¶
type ReplayDecoder struct { ByteToMessageDecoder // contains filtered or unexported fields }
func NewReplayDecoder ¶
func NewReplayDecoder(state ReplayState, decode func(ctx HandlerContext, in buf.ByteBuf, out *utils.Queue)) *ReplayDecoder
func (*ReplayDecoder) Added ¶
func (h *ReplayDecoder) Added(ctx HandlerContext)
func (*ReplayDecoder) Checkpoint ¶
func (h *ReplayDecoder) Checkpoint(state ReplayState)
func (*ReplayDecoder) Read ¶
func (h *ReplayDecoder) Read(ctx HandlerContext, obj interface{})
func (*ReplayDecoder) Skip ¶
func (h *ReplayDecoder) Skip()
func (*ReplayDecoder) State ¶
func (h *ReplayDecoder) State() ReplayState
type ReplayState ¶
type ReplayState int
type ServerBootstrap ¶
type ServerBootstrap interface { Bootstrap ChildHandler(handler Handler) ServerBootstrap SetChildParams(key ParamKey, value interface{}) ServerBootstrap ChildParams() *Params Bind(localAddr net.Addr) Future }
func NewServerBootstrap ¶
func NewServerBootstrap() ServerBootstrap
type ServerChannel ¶
type Unsafe ¶
type UnsafeAccept ¶
type UnsafeBind ¶
type UnsafeClose ¶
type UnsafeClose interface {
UnsafeClose() error
}
type UnsafeConnect ¶
type UnsafeDisconnect ¶
type UnsafeDisconnect interface {
UnsafeDisconnect() error
}
type UnsafeRead ¶
type UnsafeWrite ¶
type UnsafeWrite interface {
UnsafeWrite(obj interface{}) error
}
Source Files ¶
- bootstrap.go
- bytetomessagedecoder.go
- channel.go
- channelfuture.go
- conn.go
- handler.go
- handlercontext.go
- indicatehandler.go
- initializer.go
- messagetobyteencoder.go
- netchannel.go
- netserverchannel.go
- netstatushandler.go
- paramkey.go
- pipeline.go
- replaydecoder.go
- serverbootstrap.go
- serverchannel.go
- unsafe.go
Click to show internal directories.
Click to hide internal directories.