Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRequest ¶
func NewRequest(t *testing.T, info *RequestInfo) *httptest.ResponseRecorder
NewRequest simulates a new http request executed against the api
Types ¶
type RequestAuth ¶
RequestAuth represents the auth data for a request
func NewRequestAuth ¶
func NewRequestAuth(sessionID string, userID string) *RequestAuth
NewRequestAuth creates a new
func (*RequestAuth) ToBasicAuth ¶
func (ra *RequestAuth) ToBasicAuth() string
ToBasicAuth returns the data using the basic auth format
type RequestInfo ¶
type RequestInfo struct { Endpoint *router.Endpoint Params interface{} // Optional Auth *RequestAuth // Optional // Router is used to parse Mux Variables. Default on the api router Router *mux.Router // contains filtered or unexported fields }
RequestInfo represents the params accepted by NewRequest
func (*RequestInfo) Body ¶
func (ri *RequestInfo) Body() (*bytes.Buffer, error)
Body returns the full Body of the request
func (*RequestInfo) ParseParams ¶
func (ri *RequestInfo) ParseParams()
ParseParams parses the params and copy them in the right list: urlParams, bodyParams, and queryParams
func (*RequestInfo) PopulateQuery ¶
func (ri *RequestInfo) PopulateQuery(qs *url.Values)
PopulateQuery populate the query string of a request
Click to show internal directories.
Click to hide internal directories.