Versions in this module Expand all Collapse all v0 v0.0.3 Dec 14, 2019 v0.0.2 Dec 14, 2019 Changes in this version + const CompressBestCompression + const CompressBestSpeed + const CompressHuffman + const CompressNone + const CompressSnappy + const CompressZip + const LoggerLevelDPanic + const LoggerLevelDebug + const LoggerLevelError + const LoggerLevelFatal + const LoggerLevelInfo + const LoggerLevelPanic + const LoggerLevelWarn + var EndPointType_name = map[int32]string + var EndPointType_value = map[string]int32 + var ErrNullPeerAddr = perrors.New("peer address is nil") + var ErrSessionBlocked = perrors.New("session Full Blocked") + var ErrSessionClosed = perrors.New("session Already Closed") + func GetTimeWheel() *gxtime.Wheel + func IsSameAddr(a1, a2 net.Addr) bool + func SetLogger(logger Logger) + func SetLoggerCallerDisable() error + func SetLoggerLevel(level LoggerLevel) error + type Client interface + func NewTCPClient(opts ...ClientOption) Client + func NewUDPClient(opts ...ClientOption) Client + func NewWSClient(opts ...ClientOption) Client + func NewWSSClient(opts ...ClientOption) Client + type ClientOption func(*ClientOptions) + func WithConnectionNumber(num int) ClientOption + func WithReconnectInterval(reconnectInterval int) ClientOption + func WithRootCertificateFile(cert string) ClientOption + func WithServerAddress(addr string) ClientOption + type ClientOptions struct + type CompressType int + type Connection interface + GetActive func() time.Time + ID func() uint32 + LocalAddr func() string + RemoteAddr func() string + SetCompressType func(CompressType) + SetReadTimeout func(time.Duration) + SetWriteTimeout func(time.Duration) + UpdateActive func() + type EndPoint interface + Close func() + EndPointType func() EndPointType + ID func() EndPointID + IsClosed func() bool + RunEventLoop func(newSession NewSessionCallback) + type EndPointID = int32 + type EndPointType int32 + const TCP_CLIENT + const TCP_SERVER + const UDP_CLIENT + const UDP_ENDPOINT + const WSS_CLIENT + const WSS_SERVER + const WS_CLIENT + const WS_SERVER + func (x EndPointType) String() string + type EventListener interface + OnClose func(Session) + OnCron func(Session) + OnError func(Session, error) + OnMessage func(Session, interface{}) + OnOpen func(Session) error + type Logger interface + Debug func(args ...interface{}) + Debugf func(fmt string, args ...interface{}) + Error func(args ...interface{}) + Errorf func(fmt string, args ...interface{}) + Info func(args ...interface{}) + Infof func(fmt string, args ...interface{}) + Warn func(args ...interface{}) + Warnf func(fmt string, args ...interface{}) + func GetLogger() Logger + type LoggerLevel int8 + type NewSessionCallback func(Session) error + type ReadWriter interface + type Reader interface + Read func(Session, []byte) (interface{}, int, error) + type Server interface + Listener func() net.Listener + func NewTCPServer(opts ...ServerOption) Server + func NewUDPPEndPoint(opts ...ServerOption) Server + func NewWSSServer(opts ...ServerOption) Server + func NewWSServer(opts ...ServerOption) Server + type ServerOption func(*ServerOptions) + func WithLocalAddress(addr string) ServerOption + func WithWebsocketServerCert(cert string) ServerOption + func WithWebsocketServerPath(path string) ServerOption + func WithWebsocketServerPrivateKey(key string) ServerOption + func WithWebsocketServerRootCert(cert string) ServerOption + type ServerOptions struct + type Session interface + Close func() + Conn func() net.Conn + EndPoint func() EndPoint + GetAttribute func(interface{}) interface{} + IsClosed func() bool + RemoveAttribute func(interface{}) + Reset func() + SetAttribute func(interface{}, interface{}) + SetCronPeriod func(int) + SetEventListener func(EventListener) + SetMaxMsgLen func(int) + SetName func(string) + SetPkgHandler func(ReadWriter) + SetRQLen func(int) + SetReader func(Reader) + SetTaskPool func(*gxsync.TaskPool) + SetWQLen func(int) + SetWaitTime func(time.Duration) + SetWriter func(Writer) + Stat func() string + WriteBytes func([]byte) error + WriteBytesArray func(...[]byte) error + WritePkg func(pkg interface{}, timeout time.Duration) error + type UDPContext struct + PeerAddr *net.UDPAddr + Pkg interface{} + func (c UDPContext) String() string + type Values struct + func (c Values) Delete(key interface{}) + func (c Values) Set(key interface{}, value interface{}) + func (v Values) Get(key interface{}) (interface{}, bool) + type ValuesContext struct + func NewValuesContext(ctx context.Context) *ValuesContext + func (c *ValuesContext) Delete(key interface{}) + func (c *ValuesContext) Get(key interface{}) (interface{}, bool) + func (c *ValuesContext) Set(key interface{}, value interface{}) + type Writer interface + Write func(Session, interface{}) ([]byte, error)