Documentation ¶
Index ¶
- type Echo
- func (s *Echo) Close()
- func (s *Echo) Get() interface{}
- func (s *Echo) KeyZaps(ext ...zap.Field) []zap.Field
- func (s *Echo) Logger() *ulog.Logger
- func (s *Echo) Read(bs []byte) error
- func (s *Echo) ReleaseRef()
- func (s *Echo) RemoteAddr() string
- func (s *Echo) RemoteZap() zap.Field
- func (s *Echo) Send(bs []byte) error
- func (s *Echo) Set(v interface{})
- func (s *Echo) SetRemoteAddr(addr string)
- func (s *Echo) Start()
- type EchoMgr
- type IConnMgr
- type IEcho
- type IKeyZap
- type ISession
- type MOption
- type NetIO
- type Option
- type Server
- type Session
- func (s *Session) Close()
- func (s *Session) Get() interface{}
- func (s *Session) KeyZaps(ext ...zap.Field) []zap.Field
- func (s *Session) Logger() *ulog.Logger
- func (s *Session) Read(bs []byte) error
- func (s *Session) RemoteAddr() string
- func (s *Session) RemoteZap() zap.Field
- func (s *Session) Send(bs []byte) error
- func (s *Session) Set(v interface{})
- func (s *Session) SetRemoteAddr(addr string)
- func (s *Session) Start()
- func (s *Session) UpdateHandler(rh ISession)
- type SessionMgr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Echo ¶ added in v0.5.3
type Echo struct {
// contains filtered or unexported fields
}
Echo 应答式session
func (*Echo) Close ¶ added in v0.5.8
func (s *Echo) Close()
Close : close session just close connection
func (*Echo) ReleaseRef ¶ added in v0.5.8
func (s *Echo) ReleaseRef()
ReleaseRef : when Echo session is disposed, this function should be called to decrease connection counter 减少引用计数
func (*Echo) SetRemoteAddr ¶ added in v0.5.8
SetRemoteAddr :
type EchoMgr ¶ added in v0.5.3
type EchoMgr struct {
// contains filtered or unexported fields
}
EchoMgr :
type IConnMgr ¶
type IConnMgr interface { //ConnCount 当前连接数 ConnCount() int32 //Do handle connection Do(conn net.Conn) //SetLogger setup logger SetLogger(logger *ulog.Logger) }
IConnMgr interface 连接管理接口
type IEcho ¶ added in v0.5.3
type IEcho interface { //RunEcho : RunEcho(s *Echo) }
IEcho echo handler
type ISession ¶ added in v0.5.0
type ISession interface { //Read : read Read(s *Session) error //OnExit : on exit -- for notify OnExit(s *Session) }
ISession session handler
type MOption ¶
type MOption func(o *_SessMgrOpt)
MOption session mgr option
func WithReadTimeout ¶
WithReadTimeout : setup read timeout
func WithWriteTimeout ¶
WithWriteTimeout : setup write timeout
type NetIO ¶ added in v0.5.8
type NetIO interface { //Set set session related value Set(v interface{}) //Get get session related value Get() interface{} //SetRemoteAddr : SetRemoteAddr(addr string) //RemoteAddr : RemoteAddr() string //Send : send bytes Send(bs []byte) error //Read : read specific bytes Read(bs []byte) error //Close : close session Close() //Logger : get uber logger Logger() *ulog.Logger //RemoteZap : for uber log RemoteZap() zap.Field //KeyZaps : for uber log, key info KeyZaps(ext ...zap.Field) []zap.Field }
NetIO : net io
type Option ¶
type Option func(o *_SrvStartOpt)
Option server start option
func WithAccMaxDelay ¶
WithAccMaxDelay : setup acceptMaxDelay
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server : tcp server frame
func NewTCPSrvX ¶
NewTCPSrvX : use a simple IConnMgr
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session session SessionMgr的handler作为缺省的handler rh作为自己独立的handler 优先使用rh,如果rh为空,使用SessionMgr
func (*Session) Close ¶ added in v0.5.8
func (s *Session) Close()
Close : close session use close send msg queue to exit loop read/write go routine
func (*Session) SetRemoteAddr ¶ added in v0.5.2
SetRemoteAddr :
func (*Session) UpdateHandler ¶ added in v0.6.3
UpdateHandler : update handler