rate_limit

command
v0.0.0-...-922015f Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

README

Rate Limiting

It is a way of constraining the number of times some kind of resources is accessed to some finite number per unit of time. Resources can be anything like API connections, disk reads/writes, errors, network packets.

The reason this is mostly done is to prevent entire classes of attack vectors against our system. If you don't rate limit requests to your system, you cannot easily secure it. Also rate limiting a user requests can be advantageous to the application.

Most rate limiting is done by utilizing an algorithm called the token bucket. In production, there can be multiple layers of rate limiting.

Documentation

Overview

Package main is an implementation of the token bucket algorithm to rate limit requests.

It assumes there's an access to an API and a Go client has been created to utilize it. The API has two endpoints, one for reading a file, and another to resolve domain name to an IP address

Jump to

Keyboard shortcuts

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