testcorpus

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package testcorpus builds deterministic synthetic API transaction corpora for benchmarks and performance-verification tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(opts Options) []proxy.APITransaction

Build returns a deterministic corpus of N transactions.

func WriteSessionFile

func WriteSessionFile(dir, name string, txs []proxy.APITransaction) error

WriteSessionFile writes transactions to a session file in the same layout FileStorage produces: a JSON array, one transaction per line.

Types

type Options

type Options struct {
	// N is the total number of transactions.
	N int
	// Paths is the number of distinct request paths; 0 defaults to 10.
	Paths int
	// DistinctBodies is the number of structurally distinct body shapes;
	// 0 defaults to N.
	DistinctBodies int
	// RepeatedBodies cycles transactions through DistinctBodies byte-identical
	// body shapes. When false, every transaction receives a structurally
	// unique body.
	RepeatedBodies bool
}

Options configures corpus generation.

Jump to

Keyboard shortcuts

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