test

package
v1.0.19 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiKey   = "my-api-key"
	ClientID = "my-client-id"
)

Variables

This section is empty.

Functions

func Body

func Body(t *testing.T, r *http.Request) string

func FullURL

func FullURL(r *http.Request) string

func NewTestClient

func NewTestClient(fn http.RoundTripper) *http.Client

NewTestClient returns *http.Client with Transport replaced to avoid making real calls

func TimeFromString

func TimeFromString(t *testing.T, format, datetime string) time.Time

Types

type RoundTripFunc

type RoundTripFunc func(req *http.Request) *http.Response

RoundTripFunc .

func (RoundTripFunc) RoundTrip

func (f RoundTripFunc) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip .

Jump to

Keyboard shortcuts

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