Help us shape the future of Go! Take the 2026 Go Developer Survey

contracttest

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package contracttest provides reusable protected limiter conformance suites.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Limiter

func Limiter(t *testing.T, newBackend func(context.Context) (vk.LimiterBackend, error))

Limiter exercises atomicity, isolation, non-consuming denials, retry metadata, cancellation, permanent retirement, health and close on independently owned backends. New must return a fresh backend and honor its context.

func LimiterRefill

func LimiterRefill(t *testing.T, newBackend func(context.Context, vk.Clock) (vk.LimiterBackend, error))

LimiterRefill verifies that repeated/concurrent denials never reserve future tokens. Both implementations receive the same deterministic clock.

Types

This section is empty.

Jump to

Keyboard shortcuts

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