https://github.com/pyropy/round-robin
generic round-robin balancing algorithm written in golang
https://github.com/pyropy/round-robin
Last synced: 5 months ago
JSON representation
generic round-robin balancing algorithm written in golang
- Host: GitHub
- URL: https://github.com/pyropy/round-robin
- Owner: pyropy
- License: mit
- Fork: true (hlts2/round-robin)
- Created: 2023-09-04T16:13:10.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-09-04T16:31:47.000Z (over 2 years ago)
- Last Synced: 2024-05-28T17:07:36.924Z (about 2 years ago)
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# round-robin
generic round-robin is balancing algorithm written in golang
## Installation
```shell
go get github.com/pyropy/round-robin
```
## Example
```go
rr, _ := roundrobin.New(
&url.URL{Host: "192.168.33.10"},
&url.URL{Host: "192.168.33.11"},
&url.URL{Host: "192.168.33.12"},
&url.URL{Host: "192.168.33.13"},
)
rr.Next() // {Host: "192.168.33.10"}
rr.Next() // {Host: "192.168.33.11"}
rr.Next() // {Host: "192.168.33.12"}
rr.Next() // {Host: "192.168.33.13"}
rr.Next() // {Host: "192.168.33.10"}
rr.Next() // {Host: "192.168.33.11"}
```
## Author
[hlts2](https://github.com/hlts2)
## LICENSE
round-robin released under MIT license, refer [LICENSE](https://github.com/pyropy/round-robin/blob/master/LICENSE) file.