protocol

package
v0.0.0-...-9ef372b Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIncompletePacket = errors.New("incomplete packet")

Functions

This section is empty.

Types

type SimpleCodec

type SimpleCodec struct{}

SimpleCodec Protocol format:

* 0 2 6 * +-----------+-----------------------+ * | magic | body len | * +-----------+-----------+-----------+ * | | * + + * | body bytes | * + + * | ... ... | * +-----------------------------------+

func (*SimpleCodec) Decode

func (codec *SimpleCodec) Decode(c gnet.Conn) ([]byte, error)

func (SimpleCodec) Encode

func (codec SimpleCodec) Encode(buf []byte) ([]byte, error)

func (SimpleCodec) Unpack

func (codec SimpleCodec) Unpack(buf []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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