https://github.com/hueristiq/hq-go-limiter
A Go(Golang) package for handling rate limiting.
https://github.com/hueristiq/hq-go-limiter
go golang golang-package rate-limit rate-limiter rate-limiting ratelimit ratelimiter
Last synced: 6 months ago
JSON representation
A Go(Golang) package for handling rate limiting.
- Host: GitHub
- URL: https://github.com/hueristiq/hq-go-limiter
- Owner: hueristiq
- License: mit
- Created: 2023-06-23T11:32:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-12T18:22:23.000Z (8 months ago)
- Last Synced: 2025-03-24T15:47:26.008Z (7 months ago)
- Topics: go, golang, golang-package, rate-limit, rate-limiter, rate-limiting, ratelimit, ratelimiter
- Language: Makefile
- Homepage: https://pkg.go.dev/github.com/hueristiq/hq-go-limiter
- Size: 23.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# hq-go-limiter
 [](https://github.com/hueristiq/hq-go-limiter/blob/master/LICENSE)  [](https://github.com/hueristiq/hq-go-limiter/issues?q=is:issue+is:open) [](https://github.com/hueristiq/hq-go-limiter/issues?q=is:issue+is:closed) [](https://github.com/hueristiq/hq-go-limiter/blob/master/CONTRIBUTING.md)
A [Go(Golang)](https://golang.org/) package for handling rate limiting.
## Resource
* [Features](#features)
* [Installation](#installation)
* [Usage](#usage)
* [Contributing](#contributing)
* [Licensing](#licensing)
* [Credits](#credits)
* [Contributors](#contributors)
* [Similar Projects](#similar-projects)## Features
## Installation
To install the package, run the following command in your terminal:
```bash
go get -v -u github.com/hueristiq/hq-go-limiter
```This command will download and install the `hq-go-limiter` package into your Go workspace, making it available for use in your projects.
## Usage
Here's a simple example demonstrating how to use `hq-go-limiter`:
```go
package mainimport (
"fmt"
limiter "github.com/hueristiq/hq-go-limiter"
)func main() {
options := &limiter.Options{
RequestsPerMinute: 40,
MinimumDelayInSeconds: 2,
}ltr := limiter.New(options)
// Make 10 requests and ensure that they are rate limited.
for i := 1; i <= 10; i++ {
ltr.Wait()
fmt.Printf("Request %d made at %v\n", i, time.Now())
}
}
```## Contributing
We welcome contributions! Feel free to submit [Pull Requests](https://github.com/hueristiq/hq-go-limiter/pulls) or report [Issues](https://github.com/hueristiq/hq-go-limiter/issues). For more details, check out the [contribution guidelines](https://github.com/hueristiq/hq-go-limiter/blob/master/CONTRIBUTING.md).
## Licensing
This package is licensed under the [MIT license](https://opensource.org/license/mit). You are free to use, modify, and distribute it, as long as you follow the terms of the license. You can find the full license text in the repository - [Full MIT license text](https://github.com/hueristiq/hq-go-limiter/blob/master/LICENSE).
## Credits
### Contributors
A huge thanks to all the contributors who have helped make `hq-go-limiter` what it is today!
[](https://github.com/hueristiq/hq-go-limiter/graphs/contributors)
### Similar Projects
If you're interested in more packages like this, check out:
[Uber's ratelimit](https://github.com/uber-go/ratelimit) ◇ [Project Discovery's ratelimit](https://github.com/projectdiscovery/ratelimit)