testutil

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 16 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) 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) 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) error
	Hit() int
}

Jump to

Keyboard shortcuts

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