xrate

package
v0.0.0-...-506eafd Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMinDuration = errors.New("d must larger than 1s")

Functions

This section is empty.

Types

type RateLimiter

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

func NewRateLimit

func NewRateLimit(project string, seconds, limit, burst int) (*RateLimiter, error)

func (*RateLimiter) Allow

func (l *RateLimiter) Allow(item string) (btn bool, err error)

Jump to

Keyboard shortcuts

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