test

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package test provides fixtures for testing [oakratelimiter.RequestLimiter] and [oakratelimiter.RateLimiter] implimentations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequestFactory

func GetRequestFactory(ctx context.Context) *http.Request

GetRequestFactory is the simplest request factory with no payload.

func RateLimiterTest

func RateLimiterTest(
	ctx context.Context,
	r rate.Limiter,
	parallel int,
) func(*testing.T)

func RequestLimiterTest

func RequestLimiterTest(
	ctx context.Context,
	r request.Limiter,
	parallel int,
) func(*testing.T)

Types

type RequestFactory

type RequestFactory func(context.Context) *http.Request

RequestFactory generates new requests for load testing rate limiting middleware. Use together with [MiddlewareLoadTest].

Jump to

Keyboard shortcuts

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