Documentation ¶
Index ¶
- Constants
- func BodyIOErrorProxy(req *http.Request) (*http.Response, error)
- func ErrorProxy(req *http.Request) (*http.Response, error)
- func HttpErrorProxy(req *http.Request) (*http.Response, error)
- func NewIOErrorResponse() *http.Response
- func NewResponse(httpStatus int, content []byte, kv ...string) *http.Response
- func ParseRaw(rawUri string) *url.URL
- func Pattern(req *http.Request) string
- func ReadContent(rawHttp []byte) (*bytes.Buffer, error)
- func ReadRequest(uri *url.URL) (*http.Request, error)
- func ReadResponse(uri *url.URL) (*http.Response, error)
- type Args
- type ReaderCloser
Constants ¶
View Source
const ( HttpErrorUri = "proxy://www.httperror.com" BodyIOErrorUri = "proxy://www.bodyioerror.com" )
Variables ¶
This section is empty.
Functions ¶
func BodyIOErrorProxy ¶
BodyIOErrorProxy - reusable body I/O error proxy
func ErrorProxy ¶
ErrorProxy - test proxy for http and body I/O errors
func HttpErrorProxy ¶
HttpErrorProxy - reusable http error proxy
func NewIOErrorResponse ¶
NewIOErrorResponse - create a response that contains a body that will generate an I/O error when read
func NewResponse ¶
NewResponse - create a new response from the provided parameters
Types ¶
type ReaderCloser ¶
ReaderCloser - test type for a body.ReadCloser interface
func NewReaderCloser ¶
func NewReaderCloser(reader io.Reader, err error) *ReaderCloser
func (*ReaderCloser) Close ¶
func (r *ReaderCloser) Close() error
Click to show internal directories.
Click to hide internal directories.