testutil

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPort

func NewPort() (int, error)

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 NewUpstreamServer

func NewUpstreamServer(t *testing.T, host string) *httptest.Server

Types

type Relayer

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

func NewRelayer

func NewRelayer(h map[string]string) *Relayer

func (*Relayer) GetCertificate

func (r *Relayer) GetCertificate(i *tls.ClientHelloInfo) (*tls.Certificate, error)

func (*Relayer) GetUpstream

func (r *Relayer) GetUpstream(req *http.Request) (*url.URL, error)

func (*Relayer) Rewrite

func (r *Relayer) Rewrite(*httputil.ProxyRequest) error

type RoundTripOnErrorRelayer

type RoundTripOnErrorRelayer struct {
	SimpleRelayer
}

func NewRoundTripOnErrorRelayer

func NewRoundTripOnErrorRelayer(h map[string]string) *RoundTripOnErrorRelayer

func (*RoundTripOnErrorRelayer) RoundTripOnError

func (r *RoundTripOnErrorRelayer) RoundTripOnError(req *http.Request) (*http.Response, error)

type SimpleRelayer

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

func NewSimpleRelayer

func NewSimpleRelayer(h map[string]string) *SimpleRelayer

func (*SimpleRelayer) GetUpstream

func (r *SimpleRelayer) GetUpstream(req *http.Request) (*url.URL, error)

Jump to

Keyboard shortcuts

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