Documentation
¶
Overview ¶
The Tideland Go REST Server Library restaudit package is a little helper package for the unit testing of the rest package and the resource handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { Method string Path string Header KeyValues Cookies KeyValues Body []byte RequestProcessor func(req *http.Request) *http.Request }
Request wraps all infos for a test request.
type TestServer ¶
type TestServer interface { // Close shuts down the server and blocks until all outstanding // requests have completed. Close() // DoRequest performs a request against the test server. DoRequest(req *Request) *Response // DoUpload is a special request for uploading a file. DoUpload(path, fieldname, filename, data string) *Response }
func StartServer ¶
func StartServer(handler http.Handler, assert audit.Assertion) TestServer
StartServer starts a test server using the passed handler
Click to show internal directories.
Click to hide internal directories.