testutil

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReverseProxyNGINXServer

func NewReverseProxyNGINXServer(t testing.TB, hostname string, upstreams map[string]string) string

func NewUpstreamEchoNGINXServer

func NewUpstreamEchoNGINXServer(t testing.TB, hostname string, bodySize int) string

func WarmUpToCreateCache

func WarmUpToCreateCache(t testing.TB, urlstr, hostname string, concurrency, cacherange int)

Types

type AllCache

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

func NewAllCache

func NewAllCache(t testing.TB) *AllCache

func (*AllCache) Hit

func (c *AllCache) Hit() int

func (*AllCache) Load

func (c *AllCache) Load(req *http.Request) (*http.Request, *http.Response, error)

func (*AllCache) Store

func (c *AllCache) Store(req *http.Request, res *http.Response, _ time.Time) error

type Cacher

type Cacher interface {
	Load(req *http.Request) (cachedReq *http.Request, cachedRes *http.Response, err error)
	Store(req *http.Request, res *http.Response, now time.Time) error
	Hit() int
}

Jump to

Keyboard shortcuts

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