encoding

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeMessage

func DecodeMessage(b *bytes.Buffer) (msg *entities.Message, err error)

DecodeMessage decodes message from buffer.

func DecodeMessageFromBytes

func DecodeMessageFromBytes(b []byte) (msg *entities.Message, err error)

DecodeMessageFromBytes decodes message from bytes.

func DecodeSession

func DecodeSession(b *bytes.Buffer) (sess *entities.Session, err error)

DecodeSession decodes a session from a byte buffer

func EncodeMessage

func EncodeMessage(msg *entities.Message, b *bytes.Buffer)

EncodeMessage encodes message into bytes and write it to the buffer

func EncodeSession

func EncodeSession(sess *entities.Session, b *bytes.Buffer)

EncodeSession encodes a session into a byte buffer

func ReadBool

func ReadBool(r *bytes.Buffer) (bool, error)

ReadBool reads a bool from a byte buffer

func ReadString

func ReadString(r *bytes.Buffer) (b []byte, err error)

ReadString reads a string from a byte buffer

func ReadUint16

func ReadUint16(r *bytes.Buffer) (uint16, error)

ReadUint16 reads an uint16 from a byte buffer

func ReadUint32

func ReadUint32(r *bytes.Buffer) (uint32, error)

ReadUint32 reads an uint32 from a byte buffer

func WriteBool

func WriteBool(w *bytes.Buffer, b bool)

WriteBool writes a boolean value into a byte buffer

func WriteString

func WriteString(w *bytes.Buffer, s []byte)

WriteString writes a string into a byte buffer as a length-value

func WriteUint16

func WriteUint16(w *bytes.Buffer, i uint16)

WriteUint16 writes an uint16 into a byte buffer

func WriteUint32

func WriteUint32(w *bytes.Buffer, i uint32)

WriteUint32 writes an uint into a byte buffer

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL