Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thedevsaddam/traffic
Thread safe load-balancer package for Golang
https://github.com/thedevsaddam/traffic
Last synced: 18 days ago
JSON representation
Thread safe load-balancer package for Golang
- Host: GitHub
- URL: https://github.com/thedevsaddam/traffic
- Owner: thedevsaddam
- License: mit
- Created: 2023-02-07T17:35:46.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-13T07:11:58.000Z (over 1 year ago)
- Last Synced: 2024-06-19T18:12:26.205Z (5 months ago)
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
traffic
==================[![Build Status](https://travis-ci.org/thedevsaddam/traffic.svg?branch=master)](https://travis-ci.org/thedevsaddam/traffic)
[![Project status](https://img.shields.io/badge/version-1.0-green.svg)](https://github.com/thedevsaddam/traffic/releases)
[![Go Report Card](https://goreportcard.com/badge/github.com/thedevsaddam/traffic)](https://goreportcard.com/report/github.com/thedevsaddam/traffic)
[![Coverage Status](https://coveralls.io/repos/github/thedevsaddam/traffic/badge.svg?branch=master)](https://coveralls.io/github/thedevsaddam/traffic?branch=master)
[![GoDoc](https://godoc.org/github.com/thedevsaddam/traffic?status.svg)](https://pkg.go.dev/github.com/thedevsaddam/traffic)
[![License](https://img.shields.io/dub/l/vibe-d.svg)](https://github.com/thedevsaddam/traffic/blob/main/LICENSE.md)Thread safe load-balancer package for Golang
### Installation
Install the package using
```go
$ go get github.com/thedevsaddam/traffic
```### Usage
To use the package import it in your `*.go` code
```go
import "github.com/thedevsaddam/traffic"
```### Example
```go
package main
import (
"fmt""github.com/thedevsaddam/traffic"
)func main() {
t := traffic.NewWeightedRoundRobin()
t.Add("a", 5)
t.Add("b", 2)
t.Add("c", 3)for i := 0; i < 100; i++ {
fmt.Println(t.Next())
}
}```
### **Contribution**
If you are interested to make the package better please send pull requests or create an issue so that others can fix. Read the [contribution guide here](CONTRIBUTING.md).### **License**
The **traffic** is an open-source software licensed under the [MIT License](LICENSE.md).