Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Label string `json:"label" yaml:"label"` Type string `json:"type" yaml:"type"` Plugin any `json:"plugin,omitempty" yaml:"plugin,omitempty"` }
Config is the all encompassing configuration struct for all cache types. Deprecated: Do not add new components here. Instead, use the public plugin APIs. Examples can be found in: ./internal/impl.
type MessageAwareRateLimit ¶ added in v1.4.1
type MessageAwareRateLimit interface { // Add a new message part to the rate limiter. Returns true if this part triggers // the conditions of the rate-limiter. Add(ctx context.Context, parts ...*message.Part) bool // Access the rate limited resource. Returns a duration or an error if the // rate limit check fails. The returned duration is either zero (meaning the // resource may be accessed) or a reasonable length of time to wait before // requesting again. Access(ctx context.Context) (time.Duration, error) // Close the component, blocks until either the underlying resources are // cleaned up or the context is cancelled. Returns an error if the context // is cancelled. Close(ctx context.Context) error }
MessageAwareRateLimiter extends RateLimiter with message-specific rate limiting
func MetricsForMessageAwareRateLimit ¶ added in v1.4.1
func MetricsForMessageAwareRateLimit(r MessageAwareRateLimit, stats metrics.Type) MessageAwareRateLimit
MetricsForRateLimit wraps a ratelimit.V2 with a struct that implements types.RateLimit.
type V1 ¶
type V1 interface { // Access the rate limited resource. Returns a duration or an error if the // rate limit check fails. The returned duration is either zero (meaning the // resource may be accessed) or a reasonable length of time to wait before // requesting again. Access(ctx context.Context) (time.Duration, error) // Close the component, blocks until either the underlying resources are // cleaned up or the context is cancelled. Returns an error if the context // is cancelled. Close(ctx context.Context) error }
V1 is a common interface implemented by rate limits.
Click to show internal directories.
Click to hide internal directories.