Documentation ¶
Index ¶
- type Req
- func Delete(t testing.TB, addr string) *Req
- func Get(t testing.TB, addr string) *Req
- func HTTP(t testing.TB, method, addr string, body io.Reader) *Req
- func Patch(t testing.TB, addr string, body io.Reader) *Req
- func PatchJSON(t testing.TB, addr string, v interface{}) *Req
- func Post(t testing.TB, addr string, body io.Reader) *Req
- func PostJSON(t testing.TB, addr string, v interface{}) *Req
- func Put(t testing.TB, addr string, body io.Reader) *Req
- func PutJSON(t testing.TB, addr string, v interface{}) *Req
- type Resp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Req ¶
type Req struct {
// contains filtered or unexported fields
}
Req is a request builder.
func (*Req) SetFormValue ¶
type Resp ¶
type Resp struct { Req *http.Request Rec *httptest.ResponseRecorder // contains filtered or unexported fields }
Resp is a http recorder wrapper.
func (*Resp) Debug ¶
Debug sets the debugger. If true, the debugger will print the body of the response when the expected status is not received.
func (*Resp) ExpectBody ¶
ExpectBody provides an assertion against the recorder body.
func (*Resp) ExpectHeader ¶
ExpectHeader asserts that the header is in the recorder.
func (*Resp) ExpectHeaders ¶
ExpectHeaders asserts that multiple headers with values exist in the recorder.
func (*Resp) ExpectStatus ¶
ExpectStatus compares the expected status code against the recorded status code.
Click to show internal directories.
Click to hide internal directories.