Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPending = errors.New("http: request pending")
ErrPending is returned when a fetch request is still in flight.
Functions ¶
func ClearCache ¶
func ClearCache(url string)
ClearCache removes any cached response for the given URL.
func FetchJSON ¶
FetchJSON retrieves JSON data from the given URL and decodes it into v. Results are cached by URL. If a request is already in progress, FetchJSON returns ErrPending.
func FetchText ¶
FetchText retrieves text data from url. Results are cached by URL. If a request is already in progress, FetchText returns ErrPending.
func RegisterHTTPHook ¶
RegisterHTTPHook registers fn to receive HTTP request events.
func SetNativeClient ¶
SetNativeClient replaces the native HTTP client. Custom clients may reach private networks and must only receive trusted URLs. Passing nil restores the default client, which rejects private network addresses.
Types ¶
This section is empty.