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 Pattern(req *http.Request) string
- func ReadResponse(f fs.FS, name string) (*http.Response, error)
- func ReadResponseTest(name string) (*http.Response, error)
- 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 respons that contains a body that will generate an I/O error when read
func NewResponse ¶
NewResponse - create a new response from the provided parameters
func ReadResponse ¶
ReadResponse - create a response by reading the content from ad embedded file system
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.