Documentation
¶
Index ¶
- Variables
- type Action
- type BuiltInFrameCodec
- type Conn
- type DecoderConfig
- type DelimiterBasedFrameCodec
- type EncoderConfig
- type EventService
- type FixedLengthFrameCodec
- type GoroutinePool
- type ICodec
- type LB
- type LengthFieldBasedFrameCodec
- type LineBasedFrameCodec
- type Option
- func Addr(addr string) Option
- func Codec(codec ICodec) Option
- func LoadBalancing(lb LB) Option
- func LockOSThread(lockOSThread bool) Option
- func Multicore(multicore bool) Option
- func NumEventLoop(numEventLoop int) Option
- func ReusePort(reusePort bool) Option
- func TCPKeepAlive(tcpKeepAlive time.Duration) Option
- func Ticker(ticker bool) Option
- type Server
- type Service
- type TcpServer
Constants ¶
This section is empty.
Variables ¶
View Source
var CRLFByte = byte('\n')
Functions ¶
This section is empty.
Types ¶
type BuiltInFrameCodec ¶
type BuiltInFrameCodec struct {
}
type DecoderConfig ¶
type DelimiterBasedFrameCodec ¶
type DelimiterBasedFrameCodec struct {
// contains filtered or unexported fields
}
func NewDelimiterBasedFrameCodec ¶
func NewDelimiterBasedFrameCodec(delimiter byte) *DelimiterBasedFrameCodec
type EncoderConfig ¶
type EventService ¶
type EventService interface {
OnInitComplete(server Server) (action Action)
OnShutdown(server Server)
OnOpened(c Conn) (out []byte, action Action)
OnClosed(c Conn, err error) (action Action)
PreWrite()
React(frame []byte, c Conn) (out []byte, action Action)
Tick() (delay time.Duration, action Action)
}
type FixedLengthFrameCodec ¶
type FixedLengthFrameCodec struct {
// contains filtered or unexported fields
}
func NewFixedLengthFrameCodec ¶
func NewFixedLengthFrameCodec(frameLength int) *FixedLengthFrameCodec
type LB ¶
type LB = gnet.LoadBalancing
type LengthFieldBasedFrameCodec ¶
type LengthFieldBasedFrameCodec struct {
// contains filtered or unexported fields
}
func NewLengthFieldBasedFrameCodec ¶
func NewLengthFieldBasedFrameCodec(ec EncoderConfig, dc DecoderConfig) *LengthFieldBasedFrameCodec
type LineBasedFrameCodec ¶
type LineBasedFrameCodec struct {
}
type Option ¶
type Option func(*TcpServer)
func LoadBalancing ¶
func LockOSThread ¶
func NumEventLoop ¶
func TCPKeepAlive ¶
type Service ¶
type Service struct {
*gnet.EventServer
Pool *GoroutinePool
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.