{"id":47205560,"url":"https://github.com/thegeekyasian/round-robin-go","last_synced_at":"2026-03-13T13:41:35.385Z","repository":{"id":65752664,"uuid":"598576181","full_name":"thegeekyasian/round-robin-go","owner":"thegeekyasian","description":"round-robin-go is an implementation of round-robin algorithm that allows you to use your resources in a shared rational order. This project uses go generics that enables you to use any data type in your round robin implementation.","archived":false,"fork":false,"pushed_at":"2024-06-05T20:03:13.000Z","size":14,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-06-05T22:05:35.102Z","etag":null,"topics":["go","golang","load-balancer","load-balancing","round-robin","round-robin-scheduler","round-robin-simulator","roundrobin"],"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/thegeekyasian.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":"2023-02-07T11:53:24.000Z","updated_at":"2024-06-05T20:03:17.000Z","dependencies_parsed_at":"2023-02-19T16:55:14.981Z","dependency_job_id":null,"html_url":"https://github.com/thegeekyasian/round-robin-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thegeekyasian/round-robin-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thegeekyasian%2Fround-robin-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thegeekyasian%2Fround-robin-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thegeekyasian%2Fround-robin-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thegeekyasian%2Fround-robin-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thegeekyasian","download_url":"https://codeload.github.com/thegeekyasian/round-robin-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thegeekyasian%2Fround-robin-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30467814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T11:00:43.441Z","status":"ssl_error","status_checked_at":"2026-03-13T11:00:23.173Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","golang","load-balancer","load-balancing","round-robin","round-robin-scheduler","round-robin-simulator","roundrobin"],"created_at":"2026-03-13T13:41:34.780Z","updated_at":"2026-03-13T13:41:35.372Z","avatar_url":"https://github.com/thegeekyasian.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# round-robin-go\n\nround-robin-go is a round robin balancing algorithm written in golang. \n\nThe project uses go-generics, that allows you to use round-robin for any data type. With help of go generics, it has become easier for you to plugin `roundrobin` to your project.\n\n## Installation\n```shell\ngo get github.com/thegeekyasian/round-robin-go\n```\n\n## Version:\n\u003e 1.18\n\nSince Generics were introduced in go with version 1.18, the project requires go 1.18 to work.\n\n## Usage\n\n### any type\n```go\ntype resource struct {\n    id   int\n    name string\n}\n\n...\n\nrr, _ := roundrobin.New(\n    \u0026resource{1, \"resource-1\"},\n    \u0026resource{2, \"resource-2\"},\n    \u0026resource{3, \"resource-3\"},\n)\n\nrr.Next() // resource-1\nrr.Next() // resource-2\nrr.Next() // resource-3\nrr.Next() // resource-1\n```\n\n### string\n```go\none := \"One\"\ntwo := \"Two\"\nthree := \"Three\"\n\nrr, _ := roundrobin.New(\u0026one, \u0026two, \u0026three)\n\nrr.Next()\t// One\nrr.Next()\t// Two\nrr.Next()\t// Three\nrr.Next()\t// One\n```\n\n### URLs\n```go\nrr, _ := roundrobin.New(\n    \u0026url.URL{Host: \"192.168.0.1\"},\n    \u0026url.URL{Host: \"192.168.0.2\"},\n    \u0026url.URL{Host: \"192.168.0.3\"},\n    \u0026url.URL{Host: \"192.168.0.4\"},\n)\n\nrr.Next() // 192.168.0.1\nrr.Next() // 192.168.0.2\nrr.Next() // 192.168.0.3\nrr.Next() // 192.168.0.4\nrr.Next() // 192.168.0.1\nrr.Next() // 192.168.0.2\n```\n\n### Author\n* The Geeky Asian\n  * [Github](https://github.com/thegeekyasian/)\n  * [Website](https://thegeekyasian.com/)\n\n### License\nround-robin-go is released under [MIT license](https://github.com/thegeekyasian/round-robin-go/blob/master/LICENSE) (2023).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthegeekyasian%2Fround-robin-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthegeekyasian%2Fround-robin-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthegeekyasian%2Fround-robin-go/lists"}