Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GinCors ¶
func GinCors( cs *GinCorsConfig, ) gin.HandlerFunc
GinCors sets Access-Control-XXXXX header. https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
func GinHTTPLogger ¶
func GinHTTPLogger( l *logger.Logger, traceIDHeader string, clientIPHeader string, ) gin.HandlerFunc
GinHTTPLogger retrieves the request/response logs.
Types ¶
type GinCorsConfig ¶
type GinCorsConfig struct { AllowAllOrigins bool // for Access-Control-Allow-Origin AllowOrigins []string // for Access-Control-Allow-Methods AllowMethods []string // for Access-Control-Allow-Headers AllowHeaders []string // for Access-Control-Allow-Credentials AllowCredentials bool // for Access-Control-Expose-Headers ExposeHeaders []string // for Access-Control-Max-Age MaxAge time.Duration }
GinCorsConfig sets configurations.
func DefaultConfig ¶
func DefaultConfig() *GinCorsConfig
DefaultConfig returns a generic default configuration mapped to localhost.
Click to show internal directories.
Click to hide internal directories.