Documentation ¶
Overview ¶
Package utils provides a set of reusable HTTP client utilities used internally in gentleman for required functionality and testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NopCloser ¶
func NopCloser() io.ReadCloser
NopCloser returns a ReadCloser with a no-op Close
method wrapping the provided Reader r.
func ReplyWithStatus ¶
ReplyWithStatus helper to write the http.Response status code and text.
func StringReader ¶
func StringReader(body string) io.ReadCloser
StringReader creates an io.ReadCloser interface from a string.
func WriteBodyString ¶
WriteBodyString writes a string based body in a given http.Response.
Types ¶
type XMLCharDecoder ¶
XMLCharDecoder is a helper type that takes a stream of bytes (not encoded in UTF-8) and returns a reader that encodes the bytes into UTF-8. This is done because Go's XML library only supports XML encoded in UTF-8.
Click to show internal directories.
Click to hide internal directories.