fetchtest

package
v0.0.0-...-53a1486 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package fetchtest provides FetchClient implementations for use in testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchClient

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

FetchClient fetches content from a test server.

func NewFetchClient

func NewFetchClient(s *httptest.Server) *FetchClient

NewFetchClient creates and initializes a new FetchClient routing any fetch requests to the provided test server s.

func (*FetchClient) Do

func (c *FetchClient) Do(req *http.Request) (*http.Response, error)

Do sends an HTTP request to the test server and returns an HTTP response.

func (*FetchClient) Requests

func (c *FetchClient) Requests() []*http.Request

Requests returns all HTTP requests the FetchClient has received.

Jump to

Keyboard shortcuts

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