Documentation ¶
Index ¶
- func BuildDataRequest(method, url string, data map[string]interface{}) *http.Request
- func CreateFileRequestBody(path, contentType string, params map[string]string) (*bytes.Buffer, string, error)
- func ToH(z interface{}) map[string]interface{}
- type RequestModifier
- type Tape
- func (t *Tape) Delete(url string, modifiers ...RequestModifier) *httptest.ResponseRecorder
- func (t *Tape) FormatRequest(r *http.Request) string
- func (t *Tape) Get(url string, modifiers ...RequestModifier) *httptest.ResponseRecorder
- func (t *Tape) Patch(url string, data map[string]interface{}, modifiers ...RequestModifier) *httptest.ResponseRecorder
- func (t *Tape) PlayRequest(r *http.Request) *httptest.ResponseRecorder
- func (t *Tape) Post(url string, data map[string]interface{}, modifiers ...RequestModifier) *httptest.ResponseRecorder
- func (t *Tape) Put(url string, data map[string]interface{}, modifiers ...RequestModifier) *httptest.ResponseRecorder
- func (t *Tape) ToH(z interface{}) map[string]interface{}
- func (t *Tape) Upload(url string, filename string, contentType string, modifiers ...RequestModifier) (*httptest.ResponseRecorder, error)
- func (t *Tape) UploadWithParameters(url string, filename string, contentType string, params map[string]string, ...) (*httptest.ResponseRecorder, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDataRequest ¶
BuildDataRequest creates a request
Types ¶
type RequestModifier ¶
type Tape ¶
Tape can send requests to router endpoints. This is used by unit tests to check the endpoints
func (*Tape) Delete ¶
func (t *Tape) Delete(url string, modifiers ...RequestModifier) *httptest.ResponseRecorder
Delete creates, sends a DELETE request and fetches the response
func (*Tape) FormatRequest ¶
FormatRequest pretty-formats a request and returns it as a string
func (*Tape) Get ¶
func (t *Tape) Get(url string, modifiers ...RequestModifier) *httptest.ResponseRecorder
Get creates, sends a GET request and fetches the response
func (*Tape) Patch ¶
func (t *Tape) Patch(url string, data map[string]interface{}, modifiers ...RequestModifier) *httptest.ResponseRecorder
Patch creates, sends a PATCH request and fetches the response
func (*Tape) PlayRequest ¶
func (t *Tape) PlayRequest(r *http.Request) *httptest.ResponseRecorder
PlayRequest will send the request to the router and fetch the response
func (*Tape) Post ¶
func (t *Tape) Post(url string, data map[string]interface{}, modifiers ...RequestModifier) *httptest.ResponseRecorder
Post creates, sends a POST request and fetches the response
func (*Tape) Put ¶
func (t *Tape) Put(url string, data map[string]interface{}, modifiers ...RequestModifier) *httptest.ResponseRecorder
Put creates, sends a PUT request and fetches the response
func (*Tape) Upload ¶
func (t *Tape) Upload(url string, filename string, contentType string, modifiers ...RequestModifier) (*httptest.ResponseRecorder, error)
func (*Tape) UploadWithParameters ¶
func (t *Tape) UploadWithParameters(url string, filename string, contentType string, params map[string]string, modifiers ...RequestModifier) (*httptest.ResponseRecorder, error)
Click to show internal directories.
Click to hide internal directories.