pagebatch

package
v0.140.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pagebatch frames bounded groups of raw page requests and receipts.

Index

Constants

View Source
const MaxParts = 8
View Source
const MaxRequestBytes = 8 << 20

Variables

View Source
var ErrInvalidDocument = errors.New("pagebatch: invalid document")
View Source
var ErrRequestTooLarge = errors.New("pagebatch: request exceeds batch limits")

Functions

func Encode

func Encode(documents []Document) (string, []byte, error)

Encode assigns stable one-based correlation IDs for this request. The limit includes metadata and framing. Callers own the original immutable bodies.

Types

type Document

type Document struct {
	Header textproto.MIMEHeader
	Body   []byte
}

type Receipt

type Receipt struct {
	Status int
	Body   []byte
}

func Decode

func Decode(contentType string, body io.Reader, count, maxPartBytes int) ([]Receipt, error)

Decode requires an independent reply for every input and restores request order. A partial or truncated reply cannot validate the affected request.

Jump to

Keyboard shortcuts

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