ratelimiter

package
v0.0.0-...-406be09 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRateExceeded = errors.New("rate limit exceeded")

Functions

This section is empty.

Types

type Default

type Default struct {
}

func NewDefault

func NewDefault() *Default

func (*Default) Allowed

func (d *Default) Allowed(ctx context.Context, preview bool) (time.Duration, error)

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

func NewRedis

func NewRedis(client *redis.Client, ratePreview, rateProd int) *Redis

func (*Redis) Allowed

func (r *Redis) Allowed(ctx context.Context, preview bool) (time.Duration, error)

Jump to

Keyboard shortcuts

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