Versions in this module Expand all Collapse all v0 v0.0.1 Jul 24, 2020 Changes in this version + const AlgorithmHS256 + var DefaultBasicAuthConfig = BasicAuthConfig + var DefaultBodyDumpConfig = BodyDumpConfig + var DefaultBodyLimitConfig = BodyLimitConfig + var DefaultCORSConfig = CORSConfig + var DefaultCSRFConfig = CSRFConfig + var DefaultGzipConfig = GzipConfig + var DefaultJWTConfig = JWTConfig + var DefaultKeyAuthConfig = KeyAuthConfig + var DefaultLoggerConfig = LoggerConfig + var DefaultMethodOverrideConfig = MethodOverrideConfig + var DefaultProxyConfig = ProxyConfig + var DefaultRecoverConfig = RecoverConfig + var DefaultRedirectConfig = RedirectConfig + var DefaultRequestIDConfig = RequestIDConfig + var DefaultRewriteConfig = RewriteConfig + var DefaultSecureConfig = SecureConfig + var DefaultStaticConfig = StaticConfig + var DefaultTrailingSlashConfig = TrailingSlashConfig + var ErrJWTMissing = gz.NewHTTPError(http.StatusBadRequest, "missing or malformed jwt") + func AddTrailingSlash() gz.MiddlewareFunc + func AddTrailingSlashWithConfig(config TrailingSlashConfig) gz.MiddlewareFunc + func BasicAuth(fn BasicAuthValidator) gz.MiddlewareFunc + func BasicAuthWithConfig(config BasicAuthConfig) gz.MiddlewareFunc + func BodyDump(handler BodyDumpHandler) gz.MiddlewareFunc + func BodyDumpWithConfig(config BodyDumpConfig) gz.MiddlewareFunc + func BodyLimit(limit string) gz.MiddlewareFunc + func BodyLimitWithConfig(config BodyLimitConfig) gz.MiddlewareFunc + func CORS() gz.MiddlewareFunc + func CORSWithConfig(config CORSConfig) gz.MiddlewareFunc + func CSRF() gz.MiddlewareFunc + func CSRFWithConfig(config CSRFConfig) gz.MiddlewareFunc + func DefaultSkipper(gz.Context) bool + func Gzip() gz.MiddlewareFunc + func GzipWithConfig(config GzipConfig) gz.MiddlewareFunc + func HTTPSNonWWWRedirect() gz.MiddlewareFunc + func HTTPSNonWWWRedirectWithConfig(config RedirectConfig) gz.MiddlewareFunc + func HTTPSRedirect() gz.MiddlewareFunc + func HTTPSRedirectWithConfig(config RedirectConfig) gz.MiddlewareFunc + func HTTPSWWWRedirect() gz.MiddlewareFunc + func HTTPSWWWRedirectWithConfig(config RedirectConfig) gz.MiddlewareFunc + func JWT(key interface{}) gz.MiddlewareFunc + func JWTWithConfig(config JWTConfig) gz.MiddlewareFunc + func KeyAuth(fn KeyAuthValidator) gz.MiddlewareFunc + func KeyAuthWithConfig(config KeyAuthConfig) gz.MiddlewareFunc + func Logger() gz.MiddlewareFunc + func LoggerWithConfig(config LoggerConfig) gz.MiddlewareFunc + func MethodOverride() gz.MiddlewareFunc + func MethodOverrideWithConfig(config MethodOverrideConfig) gz.MiddlewareFunc + func NonWWWRedirect() gz.MiddlewareFunc + func NonWWWRedirectWithConfig(config RedirectConfig) gz.MiddlewareFunc + func Proxy(balancer ProxyBalancer) gz.MiddlewareFunc + func ProxyWithConfig(config ProxyConfig) gz.MiddlewareFunc + func Recover() gz.MiddlewareFunc + func RecoverWithConfig(config RecoverConfig) gz.MiddlewareFunc + func RemoveTrailingSlash() gz.MiddlewareFunc + func RemoveTrailingSlashWithConfig(config TrailingSlashConfig) gz.MiddlewareFunc + func RequestID() gz.MiddlewareFunc + func RequestIDWithConfig(config RequestIDConfig) gz.MiddlewareFunc + func Rewrite(rules map[string]string) gz.MiddlewareFunc + func RewriteWithConfig(config RewriteConfig) gz.MiddlewareFunc + func Secure() gz.MiddlewareFunc + func SecureWithConfig(config SecureConfig) gz.MiddlewareFunc + func Static(root string) gz.MiddlewareFunc + func StaticWithConfig(config StaticConfig) gz.MiddlewareFunc + func WWWRedirect() gz.MiddlewareFunc + func WWWRedirectWithConfig(config RedirectConfig) gz.MiddlewareFunc + type BasicAuthConfig struct + Realm string + Skipper Skipper + Validator BasicAuthValidator + type BasicAuthValidator func(string, string, gz.Context) (bool, error) + type BeforeFunc func(gz.Context) + type BodyDumpConfig struct + Handler BodyDumpHandler + Skipper Skipper + type BodyDumpHandler func(gz.Context, []byte, []byte) + type BodyLimitConfig struct + Limit string + Skipper Skipper + type CORSConfig struct + AllowCredentials bool + AllowHeaders []string + AllowMethods []string + AllowOrigins []string + ExposeHeaders []string + MaxAge int + Skipper Skipper + type CSRFConfig struct + ContextKey string + CookieDomain string + CookieHTTPOnly bool + CookieMaxAge int + CookieName string + CookiePath string + CookieSecure bool + Skipper Skipper + TokenLength uint8 + TokenLookup string + type GzipConfig struct + Level int + Skipper Skipper + type JWTConfig struct + AuthScheme string + BeforeFunc BeforeFunc + Claims jwt.Claims + ContextKey string + ErrorHandler JWTErrorHandler + ErrorHandlerWithContext JWTErrorHandlerWithContext + SigningKey interface{} + SigningKeys map[string]interface{} + SigningMethod string + Skipper Skipper + SuccessHandler JWTSuccessHandler + TokenLookup string + type JWTErrorHandler func(error) error + type JWTErrorHandlerWithContext func(error, gz.Context) error + type JWTSuccessHandler func(gz.Context) + type KeyAuthConfig struct + AuthScheme string + KeyLookup string + Skipper Skipper + Validator KeyAuthValidator + type KeyAuthValidator func(string, gz.Context) (bool, error) + type LoggerConfig struct + CustomTimeFormat string + Format string + Output io.Writer + Skipper Skipper + type MethodOverrideConfig struct + Getter MethodOverrideGetter + Skipper Skipper + type MethodOverrideGetter func(gz.Context) string + func MethodFromForm(param string) MethodOverrideGetter + func MethodFromHeader(header string) MethodOverrideGetter + func MethodFromQuery(param string) MethodOverrideGetter + type ProxyBalancer interface + AddTarget func(*ProxyTarget) bool + Next func(gz.Context) *ProxyTarget + RemoveTarget func(string) bool + func NewRandomBalancer(targets []*ProxyTarget) ProxyBalancer + func NewRoundRobinBalancer(targets []*ProxyTarget) ProxyBalancer + type ProxyConfig struct + Balancer ProxyBalancer + ContextKey string + Rewrite map[string]string + Skipper Skipper + Transport http.RoundTripper + type ProxyTarget struct + Meta gz.Map + Name string + URL *url.URL + type RecoverConfig struct + DisablePrintStack bool + DisableStackAll bool + LogLevel log.Lvl + Skipper Skipper + StackSize int + type RedirectConfig struct + Code int + type RequestIDConfig struct + Generator func() string + Skipper Skipper + type RewriteConfig struct + Rules map[string]string + Skipper Skipper + type SecureConfig struct + CSPReportOnly bool + ContentSecurityPolicy string + ContentTypeNosniff string + HSTSExcludeSubdomains bool + HSTSMaxAge int + HSTSPreloadEnabled bool + ReferrerPolicy string + Skipper Skipper + XFrameOptions string + XSSProtection string + type Skipper func(gz.Context) bool + type StaticConfig struct + Browse bool + HTML5 bool + Index string + Root string + Skipper Skipper + type TrailingSlashConfig struct + RedirectCode int + Skipper Skipper