Skip to content

thedevsaddam/traffic

Repository files navigation

traffic

Build Status Project status Go Report Card Coverage Status GoDoc License

Thread safe load-balancer package for Golang

Installation

Install the package using

$ go get github.com/thedevsaddam/traffic

Usage

To use the package import it in your *.go code

import "github.com/thedevsaddam/traffic"

Example

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.

License

The traffic is an open-source software licensed under the MIT License.

About

Thread safe load-balancer package for Golang

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages