integration

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package integration provides an interface to write integration tests for the reverse proxy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

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

Instance is a test instance of the reverse proxy corresponding to a config.

func NewInstance

func NewInstance(t *testing.T, confData []byte, containers ...[]dockerapi.Container) *Instance

NewInstance creates a new instance of the reverse proxy with the given config.

func (*Instance) Request

func (i *Instance) Request(req *http.Request) *http.Response

Request sends a request to the reverse proxy.

func (*Instance) RequestHost

func (i *Instance) RequestHost(host string) *http.Response

RequestHost sends a request to the reverse proxy with the given host.

func (*Instance) RequestHostTLS

func (i *Instance) RequestHostTLS(host string) *http.Response

RequestHostTLS sends a request to the reverse proxy with the given host, using TLS.

func (*Instance) TLSURL

func (i *Instance) TLSURL() string

TLSURL returns the TLS URL of the reverse proxy instance.

func (*Instance) URL

func (i *Instance) URL() string

URL returns the URL of the reverse proxy instance.

type MockServer

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

MockServer is a test instance of a server.

func NewMockServer

func NewMockServer(t *testing.T, handle http.HandlerFunc) *MockServer

NewMockServer creates a new test instance of a server. The server will be closed when the test function returns.

func (*MockServer) SplitHostPort

func (s *MockServer) SplitHostPort() (host, port string)

SplitHostPort returns the host and port of the server. Will call t.Fatal if the URL is invalid.

func (*MockServer) URL

func (s *MockServer) URL() string

URL returns the URL of the server.

Jump to

Keyboard shortcuts

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