middlewares

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAPIHeader

func ApplyAPIHeader(c *gin.Context)

ApplyAPIHeader adds some headers for API response.

func ApplyCORSHeader

func ApplyCORSHeader(c *gin.Context)

ApplyCORSHeader adds the Access-Control-Allow-Origin to the header of response.

func UpgradeToWebSocket

func UpgradeToWebSocket(ctx *gin.Context)

UpgradeToWebSocket upgrades the current HTTP connection to WebSocket connection and sets it as the parameter WebSocket in the context. If it cannot upgrade to WebSocket connection, a failure response will be sent to client.

func VerifyUserToken

func VerifyUserToken(ctx *gin.Context)

VerifyUserToken finds the token in incoming request and validates it. If there is a valid token, it will set the token's id as a parameter UID in the context;

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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