Package tollbooth provides rate-limiting logic to HTTP request handler.
BuildKeys generates a slice of keys to rate-limit by given limiter and request structs.
LimitByKeys keeps track number of request made by keys separated by pipe. It returns HTTPError when limit is exceeded.
LimitByRequest builds keys based on http.Request struct, loops through all the keys, and check if any one of them returns HTTPError.
LimitFuncHandler is a middleware that performs rate-limiting given request handler function.
LimitHandler is a middleware that performs rate-limiting given http.Handler struct.
NewLimiter is a convenience function to limiter.New.
|errors||Package errors provide data structure for errors.|
|libstring||Package libstring provides various string related functions.|
|limiter||Package limiter provides data structure to configure rate-limiter.|