Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client can connect to gubernator and get rate limits.
func NewClient ¶
func NewClient(reg prometheus.Registerer) *Client
NewClient creates a new gubernator client with default configuration.
type Middleware ¶
Middleware is a convenience type for functions that wrap http.Handlers.
func WithLocalRateLimiter ¶
func WithLocalRateLimiter(configs ...Config) Middleware
WithLocalRateLimiter returns a middleware that controls the amount of requests per tenant using an in-memory store.
func WithSharedRateLimiter ¶
func WithSharedRateLimiter(logger log.Logger, client *Client, configs ...Config) Middleware
WithSharedRateLimiter returns a middleware that controls the amount of requests per tenant using an external service.
Click to show internal directories.
Click to hide internal directories.