packet

package
v0.0.0-...-3d82958 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMsgSizeGreaterThanMaxLength = errors.New("message package size greater than max length")

Functions

func NewDelimiterCodec

func NewDelimiterCodec(delimiter string, maxLength uint32, ops ...Option) codec.PacketCodec

NewDelimiterCodec returns a packet codec

func NewFixedLengthCodec

func NewFixedLengthCodec(length uint32) codec.PacketCodec

NewFixedLengthCodec returns a fixed length packet codec

func NewVariableLengthCodec

func NewVariableLengthCodec() codec.PacketCodec

NewVariableLengthCodec returns a variable length packet codec

Types

type Option

type Option func(dc *delimiterCodec)

func DisableAutoAppendDelimiter

func DisableAutoAppendDelimiter() Option

DisableAutoAppendDelimiter disables the behavior of automatic appends delimiter when encode

func DisableStripDelimiter

func DisableStripDelimiter() Option

DisableStripDelimiter disable that strip delimiter when decode

Jump to

Keyboard shortcuts

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