Versions in this module Expand all Collapse all v1 v1.0.0 Apr 1, 2024 Changes in this version + const HeartBeatDefaultMsgID + const ZinxDataPack + const ZinxDataPackOld + const ZinxMessage + type BaseRequest struct + func (br *BaseRequest) Abort() + func (br *BaseRequest) BindRouter(router IRouter) + func (br *BaseRequest) BindRouterSlices([]RouterHandler) + func (br *BaseRequest) Call() + func (br *BaseRequest) GetConnection() IConnection + func (br *BaseRequest) GetData() []byte + func (br *BaseRequest) GetMessage() IMessage + func (br *BaseRequest) GetMsgID() uint32 + func (br *BaseRequest) GetResponse() IcResp + func (br *BaseRequest) Goto(HandleStep) + func (br *BaseRequest) RouterSlicesNext() + func (br *BaseRequest) SetResponse(resp IcResp) + type HandleStep int + type HeartBeatFunc func(IConnection) error + type HeartBeatMsgFunc func(IConnection) []byte + type HeartBeatOption struct + HeartBeatMsgID uint32 + MakeMsg HeartBeatMsgFunc + OnRemoteNotAlive OnRemoteNotAlive + Router IRouter + RouterSlices []RouterHandler + type IChain interface + GetIMessage func() IMessage + Proceed func(IcReq) IcResp + ProceedWithIMessage func(IMessage, IcReq) IcResp + Request func() IcReq + type IClient interface + AddInterceptor func(IInterceptor) + AddRouter func(msgID uint32, router IRouter) + Conn func() IConnection + GetErrChan func() chan error + GetLengthField func() *LengthField + GetMsgHandler func() IMsgHandle + GetName func() string + GetOnConnStart func() func(IConnection) + GetOnConnStop func() func(IConnection) + GetPacket func() IDataPack + Restart func() + SetDecoder func(IDecoder) + SetName func(string) + SetOnConnStart func(func(IConnection)) + SetOnConnStop func(func(IConnection)) + SetPacket func(IDataPack) + Start func() + StartHeartBeat func(time.Duration) + StartHeartBeatWithOption func(time.Duration, *HeartBeatOption) + Stop func() + type IConnManager interface + Add func(IConnection) + ClearConn func() + Get func(uint64) (IConnection, error) + Get2 func(string) (IConnection, error) + GetAllConnID func() []uint64 + GetAllConnIdStr func() []string + Len func() int + Range func(func(uint64, IConnection, interface{}) error, interface{}) error + Range2 func(func(string, IConnection, interface{}) error, interface{}) error + Remove func(IConnection) + type IConnection interface + Context func() context.Context + GetConnID func() uint64 + GetConnIdStr func() string + GetConnection func() net.Conn + GetMsgHandler func() IMsgHandle + GetName func() string + GetProperty func(key string) (interface{}, error) + GetTCPConnection func() net.Conn + GetWorkerID func() uint32 + GetWsConn func() *websocket.Conn + IsAlive func() bool + LocalAddr func() net.Addr + LocalAddrString func() string + RemoteAddr func() net.Addr + RemoteAddrString func() string + RemoveProperty func(key string) + Send func(data []byte) error + SendBuffMsg func(msgID uint32, data []byte) error + SendMsg func(msgID uint32, data []byte) error + SendToQueue func(data []byte) error + SetHeartBeat func(checker IHeartbeatChecker) + SetProperty func(key string, value interface{}) + Start func() + Stop func() + type IDataPack interface + GetHeadLen func() uint32 + Pack func(msg IMessage) ([]byte, error) + Unpack func([]byte) (IMessage, error) + type IDecoder interface + GetLengthField func() *LengthField + type IFrameDecoder interface + Decode func(buff []byte) [][]byte + type IFuncRequest interface + CallFunc func() + type IGroupRouterSlices interface + AddHandler func(MsgId uint32, Handlers ...RouterHandler) + Use func(Handlers ...RouterHandler) + type IHeartbeatChecker interface + BindConn func(IConnection) + BindRouter func(uint32, IRouter) + BindRouterSlices func(uint32, ...RouterHandler) + Clone func() IHeartbeatChecker + MsgID func() uint32 + Router func() IRouter + RouterSlices func() []RouterHandler + SendHeartBeatMsg func() error + SetHeartbeatFunc func(HeartBeatFunc) + SetHeartbeatMsgFunc func(HeartBeatMsgFunc) + SetOnRemoteNotAlive func(OnRemoteNotAlive) + Start func() + Stop func() + type IInterceptor interface + Intercept func(IChain) IcResp + type ILogger interface + DebugF func(format string, v ...interface{}) + DebugFX func(ctx context.Context, format string, v ...interface{}) + ErrorF func(format string, v ...interface{}) + ErrorFX func(ctx context.Context, format string, v ...interface{}) + InfoF func(format string, v ...interface{}) + InfoFX func(ctx context.Context, format string, v ...interface{}) + type IMessage interface + GetData func() []byte + GetDataLen func() uint32 + GetMsgID func() uint32 + GetRawData func() []byte + SetData func([]byte) + SetDataLen func(uint32) + SetMsgID func(uint32) + type IMsgHandle interface + AddInterceptor func(interceptor IInterceptor) + AddRouter func(msgID uint32, router IRouter) + AddRouterSlices func(msgId uint32, handler ...RouterHandler) IRouterSlices + Execute func(request IRequest) + Group func(start, end uint32, Handlers ...RouterHandler) IGroupRouterSlices + SendMsgToTaskQueue func(request IRequest) + StartWorkerPool func() + Use func(Handlers ...RouterHandler) IRouterSlices + type IRequest interface + Abort func() + BindRouter func(router IRouter) + BindRouterSlices func([]RouterHandler) + Call func() + GetConnection func() IConnection + GetData func() []byte + GetMessage func() IMessage + GetMsgID func() uint32 + GetResponse func() IcResp + Goto func(HandleStep) + RouterSlicesNext func() + SetResponse func(IcResp) + type IRouter interface + Handle func(request IRequest) + PostHandle func(request IRequest) + PreHandle func(request IRequest) + type IRouterSlices interface + AddHandler func(msgId uint32, handlers ...RouterHandler) + GetHandlers func(MsgId uint32) ([]RouterHandler, bool) + Group func(start, end uint32, Handlers ...RouterHandler) IGroupRouterSlices + Use func(Handlers ...RouterHandler) + type IServer interface + AddInterceptor func(IInterceptor) + AddRouter func(msgID uint32, router IRouter) + AddRouterSlices func(msgID uint32, router ...RouterHandler) IRouterSlices + GetConnMgr func() IConnManager + GetHeartBeat func() IHeartbeatChecker + GetLengthField func() *LengthField + GetMsgHandler func() IMsgHandle + GetOnConnStart func() func(IConnection) + GetOnConnStop func() func(IConnection) + GetPacket func() IDataPack + Group func(start, end uint32, Handlers ...RouterHandler) IGroupRouterSlices + Serve func() + ServerName func() string + SetDecoder func(IDecoder) + SetOnConnStart func(func(IConnection)) + SetOnConnStop func(func(IConnection)) + SetPacket func(IDataPack) + SetWebsocketAuth func(func(r *http.Request) error) + Start func() + StartHeartBeat func(time.Duration) + StartHeartBeatWithOption func(time.Duration, *HeartBeatOption) + Stop func() + Use func(Handlers ...RouterHandler) IRouterSlices + type IcReq interface + type IcResp interface + type Inotify interface + ConnNums func() int + DelNotifyByID func(Id uint64) + GetNotifyByID func(Id uint64) (IConnection, error) + HasIdConn func(id uint64) bool + NotifyAll func(MsgId uint32, data []byte) error + NotifyBuffAll func(MsgId uint32, data []byte) error + NotifyBuffToConnByID func(Id uint64, MsgId uint32, data []byte) error + NotifyToConnByID func(Id uint64, MsgId uint32, data []byte) error + SetNotifyID func(Id uint64, conn IConnection) + type LengthField struct + InitialBytesToStrip int + LengthAdjustment int + LengthFieldLength int + LengthFieldOffset int + MaxFrameLength uint64 + Order binary.ByteOrder + type OnRemoteNotAlive func(IConnection) + type RouterHandler func(request IRequest)