middleware

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContextRequestIDKey context request id for context
	ContextRequestIDKey = "request_id"

	// HeaderXRequestIDKey http header request ID key
	HeaderXRequestIDKey = "X-Request-ID"
)

Variables

This section is empty.

Functions

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

CORSMiddleware ... CORS (Cross-Origin Resource Sharing)

func EncryptResponseMiddleware

func EncryptResponseMiddleware(ctx *gin.Context)

func NoCache

func NoCache(c *gin.Context)

NoCache is a middleware function that appends headers to prevent the client from caching the HTTP response.

func Options

func Options(c *gin.Context)

Options is a middleware function that appends headers for options requests and aborts then exits the middleware chain and ends the request.

func RequestID

func RequestID() gin.HandlerFunc

RequestID request id middleware

func Secure

func Secure() gin.HandlerFunc

Security middleware

Types

type ResponseWriter

type ResponseWriter struct {
	gin.ResponseWriter
	// contains filtered or unexported fields
}

func (ResponseWriter) Write

func (w ResponseWriter) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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