nectarutil

package
v0.0.0-...-0e62d87 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2018 License: Apache-2.0 Imports: 6 Imported by: 8

Documentation

Overview

Package nectarutil contains tools for use with nectar.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mkquery

func Mkquery(parameters map[string]string) string

Mkquery builds a URL query string from the ? onward based on the parameter=[value] items given in the map; an empty map will return an empty string.

func ResponseStub

func ResponseStub(statusCode int, body string) *http.Response

ResponseStub returns a fake response with the given info.

Note: The Request field of the returned response will be nil; you may want to set the Request field if you have a specific request to reference.

func StubResponse

func StubResponse(resp *http.Response) *http.Response

StubResponse returns a standalone response with the detail from the original response; the full body will be read into memory and the original response's Body closed. This is used to allow the response to complete and close so the transport can be used for another request/response.

Note: Any error reading the original response's body will be ignored.

Note: The Request field of the returned response will be nil; you may want to set the Request field if you have a specific request to reference.

Types

This section is empty.

Jump to

Keyboard shortcuts

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