framing

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package framing implements Game Protocol 1's canonical unsigned-LEB128 stream frames. It does not decode or authorize Protobuf messages.

Index

Constants

View Source
const (
	MaximumGameplayFrame = uint32(1 << 20)
	MaximumResourceFrame = uint32(4 << 20)
)

Variables

View Source
var (
	ErrEmptyFrame       = errors.New("game protocol frame is empty")
	ErrFrameTooLarge    = errors.New("game protocol frame exceeds the role limit")
	ErrLengthOverflow   = errors.New("game protocol frame length overflows uint32")
	ErrNonCanonicalSize = errors.New("game protocol frame length is not canonical")
)

Functions

func Read

func Read(reader io.Reader, limit uint32) ([]byte, error)

Read reads one complete frame. It validates the length before allocating and never returns a partial payload.

func Write

func Write(writer io.Writer, payload []byte, limit uint32) error

Write writes one complete canonical frame.

Types

This section is empty.

Jump to

Keyboard shortcuts

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