package
0.0.0-20240222061808-473e3f1cf9cc
Repository: https://github.com/joyzf/zoom.git
Documentation: pkg.go.dev

# Functions

Context is a middleware that injects common prefix fields to gin.Context.
Cors add cors headers.
GetDefaultLogFormatterWithRequestID returns gin.LogFormatter with 'RequestID'.
GetLoggerConfig return gin.LoggerConfig which will write the logs to specified io.Writer with given gin.LogFormatter.
GetRequestIDFromContext returns 'RequestID' from the given context if present.
GetRequestIDFromHeaders returns 'RequestID' from the headers if present.
I118 add lang key to context.Context.
Logger instances a Logger middleware that will write the logs to gin.DefaultWriter.
LoggerWithConfig instance a Logger middleware with config.
LoggerWithFormatter instance a Logger middleware with the specified log format function.
LoggerWithWriter instance a Logger middleware with the specified writer buffer.
NoCache is a middleware function that appends headers to prevent the client from caching the HTTP response.
Options is a middleware function that appends headers for options requests and aborts then exits the middleware chain and ends the request.
RequestID is a middleware that injects a 'X-Request-ID' into the context and request/response header of each request.
Secure is a middleware function that appends security and resource access headers.

# Constants

UsernameKey defines the key in gin context which represents the owner of the secret.
XRequestIDKey defines X-Request-ID key string.

# Variables

Middlewares store registered middlewares.

# Structs

AuthOperator used to switch between different authentication strategy.

# Interfaces

AuthStrategy defines the set of methods used to do resource authentication.