wasmtest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 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 wasmtest holds test helpers for the WASM plugin host: a fake crates.io API with synthetic data, used by the host's tests and by benchmark 4 (bench/wasm).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WantRaw

func WantRaw(n int) []string

WantRaw returns the Raw values List must return for a crate with n versions.

Types

type CratesUpstream

type CratesUpstream struct {
	// contains filtered or unexported fields
}

CratesUpstream is a fake crates.io API serving GET /api/v1/crates/{name}/versions with seek pagination (meta.next_page = "?per_page=N&seek=K"), an ETag per page and 304s on If-None-Match. All data is synthetic.

func NewCratesUpstream

func NewCratesUpstream(pageSize int, crates map[string]int) *CratesUpstream

NewCratesUpstream serves the given crates, each with n versions "1.0.<n-1>" … "1.0.0" (newest first), pageSize versions per page.

func (*CratesUpstream) Authorizations

func (u *CratesUpstream) Authorizations() []string

Authorizations returns the Authorization header of every request so far.

func (*CratesUpstream) Change

func (u *CratesUpstream) Change()

Change publishes one more version of every crate, which changes every ETag.

func (*CratesUpstream) Requests

func (u *CratesUpstream) Requests() int

Requests returns the number of requests served.

func (*CratesUpstream) ServeHTTP

func (u *CratesUpstream) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

Jump to

Keyboard shortcuts

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