client

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPClient

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

HTTPClient emulates any incoming http requests.

func NewHTTPClient

func NewHTTPClient(t *testing.T) *HTTPClient

func (*HTTPClient) Do

func (c *HTTPClient) Do(req *http.Request) *http.Response

Do allows any custom requests.

func (*HTTPClient) Get

func (c *HTTPClient) Get(url string) *http.Response

Get makes GET requests and returns *http.Response.

func (*HTTPClient) GetJSON

func (c *HTTPClient) GetJSON(url string, dst any)

GetJSON makes GET request and parse response to provided destination. Fails if destination provided is invalid.

Jump to

Keyboard shortcuts

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