rate

package
v0.0.0-...-9823ec8 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package rate provides a set of rate-limit proxy and router middlewares using the golang.org/x/time/rate lib

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLimiterStore

func NewLimiterStore(maxRate float64, capacity int, backend sonicrate.Backend) sonicrate.LimiterStore

func NewMemoryStore

func NewMemoryStore(maxRate float64, capacity int) sonicrate.LimiterStore

Types

type Limiter

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

func NewLimiter

func NewLimiter(maxRate float64, capacity int) Limiter

func (Limiter) Allow

func (l Limiter) Allow() bool

Directories

Path Synopsis
Package router provides several rate-limit routers using the golang.org/x/time/rate lib
Package router provides several rate-limit routers using the golang.org/x/time/rate lib
gin

Jump to

Keyboard shortcuts

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