ratelimiting

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package ratelimiting provides rate limiting tools for sentinel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlwaysAllowLimiter

type AlwaysAllowLimiter struct{}

AlwaysAllowLimiter always passes requests.

func NewAlwaysAllowLimiter

func NewAlwaysAllowLimiter() *AlwaysAllowLimiter

func (*AlwaysAllowLimiter) Limit

func (l *AlwaysAllowLimiter) Limit() bool

type TokenBucketLimiter

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

TokenBucketLimiter does rate limiting based on token bucket algorithm.

func NewTokenBucketLimiter

func NewTokenBucketLimiter(store limiter.Store) *TokenBucketLimiter

func (*TokenBucketLimiter) Limit

func (l *TokenBucketLimiter) Limit() bool

Jump to

Keyboard shortcuts

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