Documentation ¶
Index ¶
- type H
- type JSON
- type ReqConf
- func (rc *ReqConf) DELETE(p string) *ReqConf
- func (rc *ReqConf) GET(p string) *ReqConf
- func (rc *ReqConf) HEAD(p string) *ReqConf
- func (rc *ReqConf) OPTIONS(p string) *ReqConf
- func (rc *ReqConf) PATCH(p string) *ReqConf
- func (rc *ReqConf) POST(p string) *ReqConf
- func (rc *ReqConf) PUT(p string) *ReqConf
- func (rc *ReqConf) Run(r http.Handler, response ResponseFunc)
- func (rc *ReqConf) SendFile(fn, path string) *ReqConf
- func (rc *ReqConf) SendFormData(h H) *ReqConf
- func (rc *ReqConf) SendJSON(j JSON) *ReqConf
- func (rc *ReqConf) SendMultipleFile(fn string, path []string) *ReqConf
- func (rc *ReqConf) SetDebug(b bool) *ReqConf
- func (rc *ReqConf) WithContentType(ct string) *ReqConf
- func (rc *ReqConf) WithCookies(h H) *ReqConf
- func (rc *ReqConf) WithHeader(h H) *ReqConf
- type ResponseFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReqConf ¶
type ReqConf struct {
// contains filtered or unexported fields
}
ReqConf is a request config to test api
func (*ReqConf) Run ¶
func (rc *ReqConf) Run(r http.Handler, response ResponseFunc)
Run to start api test
func (*ReqConf) SendFormData ¶
SendFormData to send multipart/form-data
func (*ReqConf) SendMultipleFile ¶
SendMultipleFile (fieldName, filepath string)
Use [] on the fieldname to send multiple file from filepath
func (*ReqConf) WithContentType ¶
WithContentType to set content-type request
func (*ReqConf) WithCookies ¶
WithCookies to set cookies request
func (*ReqConf) WithHeader ¶
WithHeader to set header request
type ResponseFunc ¶
type ResponseFunc func(*http.Request, *httptest.ResponseRecorder)
ResponseFunc response handling func type
Click to show internal directories.
Click to hide internal directories.