ratelimit

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: MIT Imports: 4 Imported by: 0

README

Rate Limiting

snet-daemon uses the Token Bucket Algorithm and the rate library.

###rate limiting configuration

  • rate_limit_per_minute (optional; default: Infinity) Defines the the rate r at which the bucket is filled with tokesn per minute. By default this parameter is set to infinity, effectively having no rate limiting.

  • burst_size (optional; default: Infinity) - Defines a "token bucket" of size b , with a maximum burst size of b events. The Burst size is ignored when the rate limit is infinity. Please note that the Burst size is ignored when the rate limit is infinity.

Configuration in JSON format

The below is an example on how rate limiting could be defined

  {
    "burst_size": 80000,
    "rate_limit_per_minute": 50000
  }

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRateLimiter

func NewRateLimiter() rate.Limiter

Types

This section is empty.

Jump to

Keyboard shortcuts

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