Documentation ¶
Index ¶
- func MockGinContext() (ctx *gin.Context)
- func MockHTTPClient() (c *http.Client)
- func MockHTTPServer(container service.Container) (server *http.Server)
- func MockHTTPServerNoCSRF(container service.Container) (server *http.Server)
- func MockHTTPServerWithWebsocketSupport(container service.Container) (server *websocket.Server, srv *netHttp.Server, port string)
- func MockMiddleware(execFn MiddlewareExecFn) (m route.Middleware)
- func MockRequestContext() (r route.RequestContext)
- func MockRouteHandler(bind BindFn, exec ExecuteFn) (h route.HandlerGenerator)
- func MockShutdown(srv *netHttp.Server) (err error)
- func MockUpgradeContext(ctx *http.RequestContext) websocket.UpgradeContext
- func MockWSClient() (c *websocket.Client)
- func MockWSServer(container service.Container) (s *websocket.Server)
- func MockWsConnection(container service.Container) (c *websocket.Connection)
- func TestAddResult(c *http.Client, url string, data interface{}, expected string) (err error)
- func TestDeleteResult(c *http.Client, url string, expected string) (err error)
- func TestGetResult(c *http.Client, url string, expected string) (err error)
- func TestStatusCode(c *http.Client, url string, expected int) (err error)
- func TestUpdateResult(c *http.Client, url string, data interface{}, expected string) (err error)
- type AuthFn
- type BindFn
- type ExecuteFn
- type MiddlewareExecFn
- type MockResponseWriter
- type RouteHandler
- type UpgradeContext
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockHTTPServer ¶
MockHTTPServer :
func MockHTTPServerNoCSRF ¶ added in v0.2.0
MockHTTPServerNoCSRF :
func MockHTTPServerWithWebsocketSupport ¶
func MockHTTPServerWithWebsocketSupport(container service.Container) (server *websocket.Server, srv *netHttp.Server, port string)
MockHTTPServerWithWebsocketSupport :
func MockMiddleware ¶
func MockMiddleware(execFn MiddlewareExecFn) (m route.Middleware)
MockMiddleware :
func MockRouteHandler ¶
func MockRouteHandler(bind BindFn, exec ExecuteFn) (h route.HandlerGenerator)
MockRouteHandler :
func MockUpgradeContext ¶
func MockUpgradeContext(ctx *http.RequestContext) websocket.UpgradeContext
MockUpgradeContext :
func MockWSServer ¶
MockWSServer :
func MockWsConnection ¶
func MockWsConnection(container service.Container) (c *websocket.Connection)
MockWsConnection :
func TestAddResult ¶
TestAddResult :
func TestDeleteResult ¶
TestDeleteResult :
func TestGetResult ¶
TestGetResult :
func TestStatusCode ¶
TestStatusCode :
Types ¶
type MiddlewareExecFn ¶
type MiddlewareExecFn func(ctx route.RequestContext) (cancel bool, err error)
MiddlewareExecFn :
type MockResponseWriter ¶
type MockResponseWriter struct { }
MockResponseWriter :
func (*MockResponseWriter) Write ¶
func (m *MockResponseWriter) Write(b []byte) (int, error)
Write :
func (*MockResponseWriter) WriteHeader ¶
func (m *MockResponseWriter) WriteHeader(statusCode int)
WriteHeader :
type RouteHandler ¶
RouteHandler :
func (*RouteHandler) Bind ¶
func (h *RouteHandler) Bind(i interface{}, r route.Request) error
Bind :
func (*RouteHandler) Execute ¶
func (h *RouteHandler) Execute() (data interface{}, err error)
Execute :
type UpgradeContext ¶
type UpgradeContext struct {
// contains filtered or unexported fields
}
UpgradeContext :
func (*UpgradeContext) HTTPContext ¶
func (muc *UpgradeContext) HTTPContext() (ctx *websocket.HTTPContext)
HTTPContext :
func (*UpgradeContext) Language ¶
func (muc *UpgradeContext) Language() (lang *language.Tag)
Language :
Click to show internal directories.
Click to hide internal directories.