{"id":18464301,"url":"https://github.com/projectdiscovery/roundrobin","last_synced_at":"2025-04-08T08:31:00.126Z","repository":{"id":37083478,"uuid":"418544073","full_name":"projectdiscovery/roundrobin","owner":"projectdiscovery","description":"roundrobin with configurable rotating strategies","archived":false,"fork":false,"pushed_at":"2023-08-21T00:49:30.000Z","size":32,"stargazers_count":14,"open_issues_count":3,"forks_count":6,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-02T21:39:01.452Z","etag":null,"topics":["lib"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/projectdiscovery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-18T14:44:22.000Z","updated_at":"2025-03-28T22:00:01.000Z","dependencies_parsed_at":"2024-06-18T19:56:28.301Z","dependency_job_id":"d8aa3fc0-3378-47ed-b860-61818cb88f12","html_url":"https://github.com/projectdiscovery/roundrobin","commit_stats":null,"previous_names":["mzack9999/roundrobin"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Froundrobin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Froundrobin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Froundrobin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Froundrobin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectdiscovery","download_url":"https://codeload.github.com/projectdiscovery/roundrobin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247804342,"owners_count":20998957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lib"],"created_at":"2024-11-06T09:09:23.629Z","updated_at":"2025-04-08T08:30:59.868Z","avatar_url":"https://github.com/projectdiscovery.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# roundrobin\n\n[![License](https://img.shields.io/github/license/projectdiscovery/roundrobin)](LICENSE.md)\n![Go version](https://img.shields.io/github/go-mod/go-version/projectdiscovery/roundrobin?filename=go.mod)\n[![Release](https://img.shields.io/github/release/projectdiscovery/roundrobin)](https://github.com/projectdiscovery/roundrobin/releases/)\n[![Checks](https://github.com/projectdiscovery/roundrobin/actions/workflows/build-test.yml/badge.svg)](https://github.com/projectdiscovery/roundrobin/actions/workflows/build-test.yml)\n[![GoDoc](https://pkg.go.dev/badge/projectdiscovery/roundrobin)](https://pkg.go.dev/github.com/projectdiscovery/roundrobin)\n\n\n\nA Golang Implementation of RoundRobin Algorithm with configurable rotating strategies.\n\n# Features\n\n- Configurable Rotating Strategies\n- Track Stats of Each Item\n- Generic Implementation\n- Concurrency Safe\n\n## Example\n\nAn Example showing usage of roundrobin as a library is specified below:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/projectdiscovery/roundrobin\"\n)\n\nfunc main() {\n\n\tips := []string{\n\t\t\"192.168.29.58\",\n\t\t\"192.168.29.1\",\n\t\t\"192.168.29.92\",\n\t}\n\n\t// create new roundrobin iterator\n\trb, err := roundrobin.New(ips...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// rb.Add adds given item to sequence\n\trb.Add(\"192.168.29.86\")\n\n\tfor i := 0; i \u003c 10; i++ {\n\t\t// rb.Next returns next item in roundrobin fashion\n\t\tval := rb.Next().String()\n\t\tfmt.Println(val)\n\t}\n\n\t/*\n\t\tOutput:\n\t\t192.168.29.58\n\t\t192.168.29.1\n\t\t192.168.29.92\n\t\t192.168.29.86\n\t\t192.168.29.58\n\t\t192.168.29.1\n\t\t192.168.29.92\n\t\t192.168.29.86\n\t\t192.168.29.58\n\t\t192.168.29.1\n\t*/\n\n}\n\n```\nFor more details refer  [GoDoc](https://pkg.go.dev/github.com/projectdiscovery/roundrobin) .\n\n## Acknowledgement\n\nInspired by `https://github.com/hlts2/round-robin`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Froundrobin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectdiscovery%2Froundrobin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Froundrobin/lists"}