Documentation
¶
Index ¶
- type Client
- func (cli *Client) DoRequest(ctx context.Context, url, method string, queryParams Params, header *Header, ...) *Response
- func (cli *Client) Get(ctx context.Context, url string, queryParams Params, header *Header, ...) *Response
- func (cli *Client) Post(ctx context.Context, url string, queryParams Params, header *Header, ...) *Response
- func (cli *Client) SetTimeout(timeout time.Duration)
- func (cli *Client) Start() *Context
- func (cli *Client) Use(handler ...HandleFunc)
- type Config
- type Context
- func (c *Context) Abort()
- func (c *Context) AddError(err error)
- func (c *Context) Fetch(ctx context.Context) *Response
- func (c *Context) FormBody(form *Form) *Context
- func (c *Context) GetError() error
- func (c *Context) Next()
- func (c *Context) SetBody(body []byte) *Context
- func (c *Context) SetHeaders(header *Header) *Context
- func (c *Context) SetMethod(method string) *Context
- func (c *Context) SetQueryParams(params Params) *Context
- func (c *Context) SetURL(url string) *Context
- type Form
- type HandleFunc
- type HandlerGroup
- type HandlersChain
- type Header
- type Params
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
HandlerGroup
// contains filtered or unexported fields
}
func (*Client) SetTimeout ¶
func (*Client) Use ¶
func (cli *Client) Use(handler ...HandleFunc)
type Context ¶
type Context struct {
Header *Header
Method string
Url string
Params Params
Body []byte
Request *http.Request
Response *http.Response
ResponseBody []byte
// contains filtered or unexported fields
}
func NewContext ¶
func (*Context) SetHeaders ¶
func (*Context) SetQueryParams ¶
type HandleFunc ¶
type HandleFunc func(c *Context)
func DefaultHTTPHandler ¶
func DefaultHTTPHandler() HandleFunc
func DefaultResponseBodyHandler ¶
func DefaultResponseBodyHandler() HandleFunc
func HandlerDebugDuration ¶
func HandlerDebugDuration() HandleFunc
func HandlerDuration ¶
func HandlerDuration() HandleFunc
func RequestBodyReaderHandler ¶
func RequestBodyReaderHandler() HandleFunc
func RequestDefaultHeaderHandler ¶
func RequestDefaultHeaderHandler() HandleFunc
func RequestParamsHandler ¶
func RequestParamsHandler() HandleFunc
type HandlerGroup ¶
type HandlerGroup struct {
Handlers HandlersChain
// contains filtered or unexported fields
}
func (*HandlerGroup) Use ¶
func (group *HandlerGroup) Use(handler ...HandleFunc)
type HandlersChain ¶
type HandlersChain []HandleFunc
type Header ¶
func DefaultFormHeader ¶
func DefaultFormHeader() *Header
func DefaultFormUrlEncodedHeader ¶
func DefaultFormUrlEncodedHeader() *Header
func DefaultJsonHeader ¶
func DefaultJsonHeader() *Header
type Response ¶
func (*Response) BodyString ¶
Click to show internal directories.
Click to hide internal directories.