Documentation ¶
Index ¶
- func GetRouter(withTemplates bool) *gin.Engine
- func MiddleWares() []gin.HandlerFunc
- func RunRequest(rc RequestConfig)
- func RunSimpleGet(path string, handler RequestFunc, reply ResponseFunc)
- func RunSimplePost(path, body string, handler RequestFunc, reply ResponseFunc)
- func TestHTTPResponse(t *testing.T, r *gin.Engine, req *http.Request, ...)
- func TestMain(m *testing.M)
- func VerifyResponse(r *httptest.ResponseRecorder, code int, data map[string]interface{}) (bool, error)
- type RequestConfig
- type RequestFunc
- type Response
- type ResponseFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MiddleWares ¶
func MiddleWares() []gin.HandlerFunc
func RunRequest ¶
func RunRequest(rc RequestConfig)
func RunSimpleGet ¶
func RunSimpleGet(path string, handler RequestFunc, reply ResponseFunc)
func RunSimplePost ¶
func RunSimplePost(path, body string, handler RequestFunc, reply ResponseFunc)
func TestHTTPResponse ¶
func TestHTTPResponse(t *testing.T, r *gin.Engine, req *http.Request, f func(w *httptest.ResponseRecorder))
Helper function to process a request and test its response
func VerifyResponse ¶
Types ¶
type RequestConfig ¶
type RequestConfig struct { Method string Path string Body string Headers map[string]string Middlewares []gin.HandlerFunc Handler RequestFunc Finaliser ResponseFunc }
type RequestFunc ¶
Click to show internal directories.
Click to hide internal directories.