ginutil

package
v0.0.0-...-08b716b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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

type TrailingSlashRouteHelper struct {
	gin.IRouter
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL