Documentation
¶
Overview ¶
Package ratelimit provides tools to work with rate limits imposed by Sentry's data ingestion pipeline.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category string
Category classifies supported payload types that can be ingested by Sentry and, therefore, rate limited.
const ( CategoryUnknown Category = "unknown" // Unknown category should not get rate limited CategoryAll Category = "" // Special category for empty categories (applies to all) CategoryError Category = "error" CategoryTransaction Category = "transaction" CategoryLog Category = "log_item" CategoryMonitor Category = "monitor" )
Known rate limit categories that are specified in rate limit headers.
type Deadline ¶
A Deadline is a time instant when a rate limit expires.
type Map ¶
Map maps categories to rate limit deadlines.
A rate limit is in effect for a given category if either the category's deadline or the deadline for the special CategoryAll has not yet expired.
Use IsRateLimited to check whether a category is rate-limited.
func FromResponse ¶
FromResponse returns a rate limit map from an HTTP response.
func (Map) Deadline ¶
Deadline returns the deadline when the rate limit for the given category or the special CategoryAll expire, whichever is furthest into the future.
func (Map) IsRateLimited ¶
IsRateLimited returns true if the category is currently rate limited.