Documentation
¶
Index ¶
- func Clear() error
- func Disable()
- func Enable()
- func Gen(api API) error
- func Init(newProject Project) error
- func IsDisabled() bool
- func PrettyPrint(in []byte) ([]byte, error)
- type API
- func (a *API) ReadRequest(req *http.Request, throwErr bool) error
- func (a *API) ReadRequestBody(req *http.Request) error
- func (a *API) ReadRequestHeader(httpHeader http.Header) error
- func (a *API) ReadRequestURLParams(uri string) error
- func (a *API) ReadResponseHeader(httpHeader http.Header) error
- func (a *API) SuppressedRequestHeaders(headers ...string)
- func (a *API) SuppressedResponseHeaders(headers ...string)
- func (a *API) WrapResponseBody(body []byte) error
- type Project
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct { // Request RequestMethod string `json:"request_method"` RequestPath string `json:"request_path"` RequestHeaders map[string]string `json:"request_headers"` RequestSuppressedHeaders map[string]bool `json:"request_suppressed_headers"` RequestURLParams map[string]string `json:"request_url_params"` RequestPostForms map[string]string `json:"request_post_forms"` RequestBody string `json:"request_body"` // Response ResponseHeaders map[string]string `json:"response_headers"` ResponseSuppressedHeaders map[string]bool `json:"response_suppressed_headers"` ResponseStatusCode int `json:"response_status_code"` ResponseBody string `json:"response_body"` }
API has request and response info
func (*API) ReadRequest ¶
ReadRequest read values from http.Request
func (*API) ReadRequestBody ¶
ReadRequestBody read request body Reference https://golang.org/src/net/http/httputil/dump.go
func (*API) ReadRequestHeader ¶
ReadRequestHeader read request http.Header
func (*API) ReadRequestURLParams ¶
ReadRequestURLParams read request uri
func (*API) ReadResponseHeader ¶
ReadResponseHeader read http.Header
func (*API) SuppressedRequestHeaders ¶
SuppressedRequestHeaders ignore request headers
func (*API) SuppressedResponseHeaders ¶
SuppressedResponseHeaders ignore response headers
func (*API) WrapResponseBody ¶
WrapResponseBody wrap body prettyprint if json
Click to show internal directories.
Click to hide internal directories.