ratelimiter

package
v0.0.0-...-43b2f59 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RateKey

func RateKey(id string, t time.Time) string

Types

type RateLimiter

type RateLimiter interface {
	Hit(ctx context.Context, id string, max int64) error
}

func New

func New(r *redis.Client, t TimeProvider, trace trace.Tracer, windowSize time.Duration) RateLimiter

type TimeProvider

type TimeProvider func() time.Time

Jump to

Keyboard shortcuts

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