Versions in this module Expand all Collapse all v3 v3.3.0 Jul 2, 2026 v3.2.1 Jul 2, 2026 Changes in this version + const ErrDecodeFailed v3.2.0 Jun 30, 2026 Changes in this version type Socket + func (s *Socket) CloseNow() error + func (s *Socket) PingContext(ctx context.Context) error + func (s *Socket) SetReadTimeout(d time.Duration) type Sockets + func (ss *Sockets) SetReadTimeout(d time.Duration) v3.1.0 Jun 9, 2026 Changes in this version + const ErrCodecNotFound + const ErrInternal + func Start(port int, path string, ...) + type AcceptOptions = websocket.AcceptOptions + type Beacon struct + func CreateBeacon(socket *Socket, interval time.Duration, callback func(time.Duration)) *Beacon + func (b *Beacon) Destroy() + func (b *Beacon) Start() + func (b *Beacon) Stop() + type BinaryEncoder struct + func CreateBinaryEncoder(codecs []*RegisteredCodec, idCodec Codec) *BinaryEncoder + func (e BinaryEncoder) Decode(data []byte) (*Message, error) + func (e BinaryEncoder) Encode(message *Message) ([]byte, error) + type BooleanCodec struct + func (c BooleanCodec) Decode(buffer *bytes.Buffer) any + func (c BooleanCodec) Encode(buffer *bytes.Buffer, data any) + type Codec interface + Decode func(buffer *bytes.Buffer) any + Encode func(buffer *bytes.Buffer, data any) + type Conn = websocket.Conn + type Float32Codec struct + func (c Float32Codec) Decode(buffer *bytes.Buffer) any + func (c Float32Codec) Encode(buffer *bytes.Buffer, data any) + type Float64Codec struct + func (c Float64Codec) Decode(buffer *bytes.Buffer) any + func (c Float64Codec) Encode(buffer *bytes.Buffer, data any) + type FloatPrecisionCodec struct + func CreateFloatPrecisionCodec[F float32 | float64, ...](codec Codec, precision int) *FloatPrecisionCodec[F, T] + func (c *FloatPrecisionCodec[F, T]) Decode(buffer *bytes.Buffer) any + func (c *FloatPrecisionCodec[F, T]) Encode(buffer *bytes.Buffer, data any) + type Int16Codec struct + func (c Int16Codec) Decode(buffer *bytes.Buffer) any + func (c Int16Codec) Encode(buffer *bytes.Buffer, data any) + type Int32Codec struct + func (c Int32Codec) Decode(buffer *bytes.Buffer) any + func (c Int32Codec) Encode(buffer *bytes.Buffer, data any) + type Int64Codec struct + func (c Int64Codec) Decode(buffer *bytes.Buffer) any + func (c Int64Codec) Encode(buffer *bytes.Buffer, data any) + type Int8Codec struct + func (c Int8Codec) Decode(buffer *bytes.Buffer) any + func (c Int8Codec) Encode(buffer *bytes.Buffer, data any) + type Message struct + Data any + Name string + type NullCodec struct + func (c NullCodec) Decode(buffer *bytes.Buffer) any + func (c NullCodec) Encode(buffer *bytes.Buffer, data any) + type RegisteredCodec struct + Handler Codec + Id uint8 + Name string + type ServerError string + func (err ServerError) Error() string + type Socket struct + Conn *websocket.Conn + Encoder *BinaryEncoder + ID uint + In chan SocketMessage + func CreateSocket(id uint, c *websocket.Conn, encoder *BinaryEncoder, in chan SocketMessage) *Socket + func (s *Socket) Close(code int, reason string) error + func (s *Socket) Handle(data []byte) + func (s *Socket) Ping() error + func (s *Socket) Run(onClose func(*Socket)) + func (s *Socket) Send(message *Message) + func (s *Socket) Write(data []byte) + type SocketMessage struct + Err error + Message *Message + Socket *Socket + type Sockets struct + Encoder *BinaryEncoder + In chan SocketMessage + List map[uint]*Socket + Out chan *Socket + func CreateSockets(encoder *BinaryEncoder, maxId uint, inBufferSize int) *Sockets + func (ss *Sockets) Add(c *websocket.Conn) (*Socket, error) + func (ss *Sockets) Clear() + func (ss *Sockets) Count() int + func (ss *Sockets) ForEach(callback func(*Socket)) + func (ss *Sockets) ForOther(socket *Socket, callback func(*Socket)) + func (ss *Sockets) Remove(socket *Socket) + func (ss *Sockets) Send(socket *Socket, message *Message) + func (ss *Sockets) SendAll(message *Message) + func (ss *Sockets) SendOther(socket *Socket, message *Message) + func (ss *Sockets) WriteAll(data []byte) + func (ss *Sockets) WriteOther(socket *Socket, data []byte) + type StringCodec struct + func (c StringCodec) Decode(buffer *bytes.Buffer) any + func (c StringCodec) Encode(buffer *bytes.Buffer, data any) + type StringLongCodec struct + func (c StringLongCodec) Decode(buffer *bytes.Buffer) any + func (c StringLongCodec) Encode(buffer *bytes.Buffer, data any) + type UInt16Codec struct + func (c UInt16Codec) Decode(buffer *bytes.Buffer) any + func (c UInt16Codec) Encode(buffer *bytes.Buffer, data any) + type UInt32Codec struct + func (c UInt32Codec) Decode(buffer *bytes.Buffer) any + func (c UInt32Codec) Encode(buffer *bytes.Buffer, data any) + type UInt64Codec struct + func (c UInt64Codec) Decode(buffer *bytes.Buffer) any + func (c UInt64Codec) Encode(buffer *bytes.Buffer, data any) + type UInt8Codec struct + func (c UInt8Codec) Decode(buffer *bytes.Buffer) any + func (c UInt8Codec) Encode(buffer *bytes.Buffer, data any) + type UIntLongCodec struct + ByteLength int + func (c UIntLongCodec) Decode(buffer *bytes.Buffer) any + func (c UIntLongCodec) Encode(buffer *bytes.Buffer, data any)