Versions in this module Expand all Collapse all v1 v1.0.5 Apr 24, 2024 v1.0.3 Apr 24, 2024 Changes in this version + func CopyMemory(src, dst []byte) int + func GetLengthDataLen(avLen uint32) uint32 + func GetValueDataPtr(v *reflect.Value) uintptr + func Move(src, dst uintptr, size uint32) + func ReadLength(bits []byte) (lengthValue uint32, readLen uint32) + func ReadString(bits []byte) (str string, readLen uint32) + func WiriteLength(bits []byte, aLength uint32) (wirteLen uint32) + func WriteString(bits []byte, str string) (writeLen uint32) + type BufferUtils struct + func NewBufferUtils(buff []byte) *BufferUtils + func (bw *BufferUtils) GetDataLen() int + func (bw *BufferUtils) GetPos() int + func (bw *BufferUtils) ReadUint16() (v uint16) + func (bw *BufferUtils) ReadUint32() (v uint32) + func (bw *BufferUtils) ReadUint64() (v uint64) + func (bw *BufferUtils) ReadUint8() (v uint8) + func (bw *BufferUtils) ResetPos(newPos int) (r bool) + func (bw *BufferUtils) Seek(offset int) bool + func (bw *BufferUtils) Write(a any) bool + type DataPack struct + Datas []byte + Head interface{} + type DefaultHeadHandler struct + func (d *DefaultHeadHandler) GetSize() uint32 + func (d *DefaultHeadHandler) ReadHead(bits []byte, head *HeadInfo) bool + func (d *DefaultHeadHandler) WriteHead(bits []byte, head *HeadInfo) bool + type FastLocker struct + func (l *FastLocker) Lock() + func (l *FastLocker) Unlock() + type HashIdType = int32 + type HeadInfo struct + BodyLen uint32 + Head interface{} + SockId int32 + type IMsgHandler interface + OnConnect func(sock SocketConnection) + OnDisconnect func(sock SocketConnection) + OnMessage func(sock SocketConnection, msg *DataPack) + type IPackHeader interface + GetSize func() uint32 + ReadHead func(bits []byte, Head *HeadInfo) bool + WriteHead func(bits []byte, Head *HeadInfo) bool + type MsgBody struct + Datas []byte + MsgHead interface{} + type MsgHeader struct + type PByteArray (*[cMaxArrSize]byte) + type PStrArray (*[cMaxArrSize]string) + type Serializer struct + func New(isLikeCStruct bool, hashTblSize int) *Serializer + func (s *Serializer) Decode(bits []byte, ptr interface{}) bool + func (s *Serializer) DecodeStruct(id HashIdType, bits []byte) (obj interface{}, isOk bool) + func (s *Serializer) Encode(ptr interface{}) (result []byte, ok bool) + func (s *Serializer) NewStruct(id HashIdType) interface{} + func (s *Serializer) RegisterType(id HashIdType, obj interface{}) bool + type SockOptions struct + HeadHandler IPackHeader + MsgHandler IMsgHandler + SockBufferSize uint32 + type SocketClient interface + Close func() + Connected func() bool + GetConnection func() SocketConnection + Open func() + func NewSocketClient(addr string, avOpts SockOptions) SocketClient + type SocketConnection interface + Disconnect func() + GetData func() interface{} + GetId func() int32 + RemoteAddr func() net.Addr + SendMsg func(packHead interface{}, avBytes []byte) bool + SetData func(usrData interface{}) + type SocketServer interface + Close func() + Foreach func(f enum_callback) + GetConnectCount func() int32 + Open func(avPort uint16) bool + SendData func(SockId int32, Data []byte) bool + SendMsg func(SockId int32, msgHead interface{}, avBytes []byte) bool + func NewSocketServer(avOpts SockOptions) SocketServer