testing

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package testing provides functionality for use when conducting tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestInstance

func NewTestInstance(
	configFile string,
	defaultPathConfigs func(*oo.Options) map[string]*po.Options,
	respCode int, respBody string, respHeaders map[string]string,
	originType, urlPath, logLevel string,
) (*httptest.Server, *httptest.ResponseRecorder, *http.Request, *http.Client, error)

NewTestInstance will start a trickster

func NewTestPathConfig

func NewTestPathConfig(
	oc *oo.Options,
	defaultPathConfigs func(*oo.Options) map[string]*po.Options,
	urlPath string,
) *po.Options

NewTestPathConfig returns a path config based on the provided parameters

func NewTestServer

func NewTestServer(responseCode int, responseBody string, headers map[string]string) *httptest.Server

NewTestServer returns a new httptest.Server that responds with the provided code, body and headers

func NewTestTracer

func NewTestTracer() *tracing.Tracer

NewTestTracer returns a standard out tracer for testing purposes

func NewTestWebClient

func NewTestWebClient() *http.Client

NewTestWebClient returns a new *http.Client configured with reasonable defaults

Types

This section is empty.

Directories

Path Synopsis
Package tls provides functionality for use when conducting tests with TLS
Package tls provides functionality for use when conducting tests with TLS

Jump to

Keyboard shortcuts

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