barista.run: barista.run/testing/httpclient Index | Files

package httpclient

import "barista.run/testing/httpclient"

Package httpclient provides a testable wrapper around an existing *http.Client.

Index

Package Files

httpclient.go

func FreezeOauthToken Uses

func FreezeOauthToken(client *http.Client, accessToken string)

FreezeOauthToken sets the client's token source to a static token source that always provides the given access token.

func Wrap Uses

func Wrap(client *http.Client, newURL string)

Wrap redirects all calls from the original *http.Client to the given host. Typical usage would be httpclient.Wrap(client, server.URL), where server is a httptest.Server or equivalent.

Package httpclient imports 4 packages (graph). Updated 2018-11-11. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).