Documentation
¶
Index ¶
- type ApiError
- type Client
- func (cl *Client) Defaults(fn defaultsFunc)
- func (cl *Client) Delete(uri string, args ...interface{}) *httptest.ResponseRecorder
- func (c *Client) Do(req *http.Request) *httptest.ResponseRecorder
- func (cl *Client) Get(uri string, res interface{}, args ...interface{}) *httptest.ResponseRecorder
- func (cl *Client) Handle(method, path string, handler gin.HandlerFunc)
- func (cl *Client) Head(uri string, args ...interface{}) *httptest.ResponseRecorder
- func (cl *Client) IgnoreErrors(ignore bool)
- func (cl *Client) NewRequest(method, uri string, reader io.Reader) *http.Request
- func (cl *Client) Options(uri string, args ...interface{}) *httptest.ResponseRecorder
- func (cl *Client) Patch(uri string, body interface{}, res interface{}, args ...interface{}) *httptest.ResponseRecorder
- func (cl *Client) Post(uri string, body interface{}, res interface{}, args ...interface{}) *httptest.ResponseRecorder
- func (c *Client) PostForm(path string, data url.Values) *httptest.ResponseRecorder
- func (c *Client) PostJSON(path string, src interface{}) *httptest.ResponseRecorder
- func (c *Client) PostRawJSON(path string, src string) *httptest.ResponseRecorder
- func (cl *Client) Put(uri string, body interface{}, res interface{}, args ...interface{}) *httptest.ResponseRecorder
- func (cl *Client) Use(mw ...gin.HandlerFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Router *gin.Engine
Context *gin.Context
// contains filtered or unexported fields
}
func (*Client) Delete ¶
func (cl *Client) Delete(uri string, args ...interface{}) *httptest.ResponseRecorder
Make DELETE request
func (*Client) Get ¶
func (cl *Client) Get(uri string, res interface{}, args ...interface{}) *httptest.ResponseRecorder
Make GET request
func (*Client) Handle ¶
func (cl *Client) Handle(method, path string, handler gin.HandlerFunc)
Add a new handler to router
func (*Client) Head ¶
func (cl *Client) Head(uri string, args ...interface{}) *httptest.ResponseRecorder
Make HEAD request
func (*Client) IgnoreErrors ¶
func (*Client) NewRequest ¶
func (*Client) Options ¶
func (cl *Client) Options(uri string, args ...interface{}) *httptest.ResponseRecorder
Make OPTIONS request
func (*Client) Patch ¶
func (cl *Client) Patch(uri string, body interface{}, res interface{}, args ...interface{}) *httptest.ResponseRecorder
Make PATCH request
func (*Client) Post ¶
func (cl *Client) Post(uri string, body interface{}, res interface{}, args ...interface{}) *httptest.ResponseRecorder
Make POST request
func (*Client) PostJSON ¶
func (c *Client) PostJSON(path string, src interface{}) *httptest.ResponseRecorder
Make POST with JSON Data
func (*Client) PostRawJSON ¶
func (c *Client) PostRawJSON(path string, src string) *httptest.ResponseRecorder
Make POST with Raw JSON Data
Click to show internal directories.
Click to hide internal directories.