Documentation ¶
Index ¶
- type FakeResponseWriter
- func (w FakeResponseWriter) CloseNotify() <-chan bool
- func (w FakeResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (w FakeResponseWriter) Pusher() http.Pusher
- func (w FakeResponseWriter) Size() int
- func (w FakeResponseWriter) Status() int
- func (w FakeResponseWriter) WriteHeaderNow()
- func (w FakeResponseWriter) Written() bool
- type TrailingSlashRouteHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeResponseWriter ¶
type FakeResponseWriter struct {
*httptest.ResponseRecorder
}
FakeResponseWriter satisfies gin.ResponseWriter.
func (FakeResponseWriter) CloseNotify ¶
func (w FakeResponseWriter) CloseNotify() <-chan bool
func (FakeResponseWriter) Hijack ¶
func (w FakeResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
func (FakeResponseWriter) Pusher ¶
func (w FakeResponseWriter) Pusher() http.Pusher
func (FakeResponseWriter) Size ¶
func (w FakeResponseWriter) Size() int
func (FakeResponseWriter) Status ¶
func (w FakeResponseWriter) Status() int
func (FakeResponseWriter) WriteHeaderNow ¶
func (w FakeResponseWriter) WriteHeaderNow()
func (FakeResponseWriter) Written ¶
func (w FakeResponseWriter) Written() bool
type TrailingSlashRouteHelper ¶
TrailingSlashRouteHelper wraps a gin.IRouter and ensures every route registered with GET has a corresponding alternate route with or without, dependent on the endpoint being registered, a trailing slash.
func (TrailingSlashRouteHelper) GET ¶
func (r TrailingSlashRouteHelper) GET(endpoint string, handler ...gin.HandlerFunc) gin.IRoutes
GET overrides the internal gin.IRouter GET. It interrogates endpoint for a trailing slash. If no trailing slash is present, it registers the endpoint and a corresponding endpoint with a trailing slash using the same handler. If it does end in a trailing slash, it does the inverse.
Click to show internal directories.
Click to hide internal directories.