middleware

package
v0.0.0-...-719b004 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimitMiddleware

type RateLimitMiddleware struct {
	// contains filtered or unexported fields
}

RateLimitMiddleware contains the data required to implement per endpoint rate limiting using a catalog of valid api keys.

For unknow endpoints we can choose if we let them pass or if we deny the access

func NewRateLimitMiddleware

func NewRateLimitMiddleware(next http.Handler, apiKeyHeader string,
	apiKeyCatalog catalog.APIKeys, redisPool *redis.Pool,
	matcher pathmatcher.Matcher) *RateLimitMiddleware

NewRateLimitMiddleware creates a new RateLimitMiddleware

Jump to

Keyboard shortcuts

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