httputil

package
v0.0.0-...-9b4d37b Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseStreams

func CloseStreams(streams ...interface{})

CloseStreams ensures that a list for http streams are properly closed.

func Error

func Error(c *gin.Context, status int, err error)

Error will return an error response in json.

func HijackConnection

func HijackConnection(w http.ResponseWriter) (io.ReadCloser, io.Writer, error)

HijackConnection interrupts the http response writer to get the underlying connection and operate with it.

func NoContent

func NoContent(c *gin.Context)

NoContent will return a no content response.

func NotImplemented

func NotImplemented(c *gin.Context)

NotImplemented will return a not implented response.

func RequestLoggerMiddleware

func RequestLoggerMiddleware() gin.HandlerFunc

RequestLoggerMiddleware is a gin-gonic middleware that will log the raw request.

func ResponseLoggerMiddleware

func ResponseLoggerMiddleware() gin.HandlerFunc

ResponseLoggerMiddleware is a gin-gonic middleware that will the raw response.

func UpgradeConnection

func UpgradeConnection(r *http.Request, out io.Writer)

UpgradeConnection will upgrade the Hijacked connection.

func VersionAliasMiddleware

func VersionAliasMiddleware(router *gin.Engine) gin.HandlerFunc

VersionAliasMiddleware is a gin-gonic middleware that will remove /v1.xx and /v4.x.y from the url path (ignoring versioned apis).

Types

This section is empty.

Jump to

Keyboard shortcuts

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