Documentation ¶
Index ¶
- Constants
- func CacheMiddleware(metricServer metrics.TaskMetrics, cache zcache.ZCache, ...) func(next http.Handler) http.Handler
- func GetRoutePattern(r *http.Request) string
- func GetSubRoutePattern(r *http.Request) string
- func JWTUsageMiddleware(zCache zcache.RemoteCache, tokenDetailsTTL, usageMetricTTL time.Duration) func(next http.Handler) http.Handler
- func LoggingMiddleware(options LoggingMiddlewareOptions) func(http.Handler) http.Handler
- func ParseCacheConfigPaths(paths map[string]string) (domain.CacheConfig, error)
- func PathToRegexp(path string) *regexp.Regexp
- func RegisterRequestMetrics(metricsServer metrics.TaskMetrics) []error
- type CacheProcessedPath
- type CorsOptions
- type LoggingMiddlewareOptions
- type Middleware
- func Cors(options CorsOptions) Middleware
- func DefaultCors() Middleware
- func ErrorHandlerMiddleware() Middleware
- func Logger(options LoggingMiddlewareOptions) Middleware
- func RateLimit(maxRPM int) Middleware
- func RateLimitByFullPath(maxRPM int) Middleware
- func RequestID() Middleware
- func RequestMetrics(metricsServer metrics.TaskMetrics) Middleware
Constants ¶
View Source
const (
PathUsageByJWTKey = "jwt_path_usage"
)
View Source
const (
RequestIDHeader = "X-Request-ID"
)
Variables ¶
This section is empty.
Functions ¶
func CacheMiddleware ¶ added in v0.14.2
func CacheMiddleware(metricServer metrics.TaskMetrics, cache zcache.ZCache, config domain.CacheConfig) func(next http.Handler) http.Handler
func GetRoutePattern ¶ added in v0.16.1
func GetSubRoutePattern ¶ added in v0.18.2
func JWTUsageMiddleware ¶ added in v0.17.0
func LoggingMiddleware ¶ added in v0.14.4
func LoggingMiddleware(options LoggingMiddlewareOptions) func(http.Handler) http.Handler
func ParseCacheConfigPaths ¶ added in v0.15.2
func ParseCacheConfigPaths(paths map[string]string) (domain.CacheConfig, error)
func PathToRegexp ¶ added in v0.15.3
func RegisterRequestMetrics ¶
func RegisterRequestMetrics(metricsServer metrics.TaskMetrics) []error
Types ¶
type CacheProcessedPath ¶ added in v0.15.3
type CorsOptions ¶
type LoggingMiddlewareOptions ¶ added in v0.15.3
type Middleware ¶
func Cors ¶
func Cors(options CorsOptions) Middleware
func DefaultCors ¶
func DefaultCors() Middleware
func ErrorHandlerMiddleware ¶
func ErrorHandlerMiddleware() Middleware
func Logger ¶
func Logger(options LoggingMiddlewareOptions) Middleware
func RateLimit ¶
func RateLimit(maxRPM int) Middleware
func RateLimitByFullPath ¶ added in v0.10.2
func RateLimitByFullPath(maxRPM int) Middleware
func RequestID ¶
func RequestID() Middleware
func RequestMetrics ¶
func RequestMetrics(metricsServer metrics.TaskMetrics) Middleware
Click to show internal directories.
Click to hide internal directories.