Documentation ¶
Index ¶
- Constants
- func BytesToInt32(buf []byte) int32
- func BytesToInt64(buf []byte) int64
- func Get[T any](conn IConnection, key int64) T
- func Init(endian string)
- func Int32ToBytes(num int32) []byte
- func Int64ToBytes(num int64) []byte
- type Default
- type IConnection
- type IPacket
- type PacketConfig
- type Tcp
- func (t *Tcp) Close() error
- func (t *Tcp) Closed() bool
- func (t *Tcp) Expired() bool
- func (t *Tcp) FD() uint64
- func (t *Tcp) Get(userId int64) (any, bool)
- func (t *Tcp) Read(hLen, bLen, bLenOffset int) ([]byte, error)
- func (t *Tcp) RemoteIp() string
- func (t *Tcp) SQueue() <-chan bool
- func (t *Tcp) Send(pack IPacket) error
- func (t *Tcp) SendBytes(buf []byte) error
- func (t *Tcp) Set(userId int64, val any)
- func (t *Tcp) WQueue() <-chan []byte
- func (t *Tcp) Write(pack []byte) (int, error)
- type WebSocket
- func (t *WebSocket) Close() error
- func (t *WebSocket) Closed() bool
- func (t *WebSocket) Expired() bool
- func (t *WebSocket) FD() uint64
- func (t *WebSocket) Get(key int64) (any, bool)
- func (t *WebSocket) Read(hLen, bLen, bLenOffset int) ([]byte, error)
- func (t *WebSocket) RemoteIp() string
- func (t *WebSocket) SQueue() <-chan bool
- func (t *WebSocket) Send(pack IPacket) error
- func (t *WebSocket) SendBytes(buf []byte) error
- func (t *WebSocket) Set(key int64, val any)
- func (t *WebSocket) WQueue() <-chan []byte
- func (t *WebSocket) Write(pack []byte) (int, error)
Constants ¶
View Source
const ( CHANNEL_PACKET_MAX = 1024 Packet_Max_Len = 2097152 )
Variables ¶
This section is empty.
Functions ¶
func BytesToInt32 ¶
func BytesToInt64 ¶
func Get ¶ added in v1.0.5
func Get[T any](conn IConnection, key int64) T
func Int32ToBytes ¶
func Int64ToBytes ¶
Types ¶
type Default ¶
type Default struct {
// contains filtered or unexported fields
}
func NewDefault ¶
func NewDefault() *Default
func (*Default) BodyOffset ¶
func (*Default) Unserialize ¶
type IConnection ¶
type IConnection interface { Read(int, int, int) ([]byte, error) Write([]byte) (int, error) Send(IPacket) error SendBytes([]byte) error Close() error FD() uint64 WQueue() <-chan []byte Closed() bool RemoteIp() string Expired() bool Set(key int64, value any) Get(key int64) (any, bool) SQueue() <-chan bool }
type PacketConfig ¶
Click to show internal directories.
Click to hide internal directories.