{"id":19288514,"url":"https://github.com/samber/go-tcp-pool","last_synced_at":"2025-04-22T04:33:34.083Z","repository":{"id":183314278,"uuid":"669933599","full_name":"samber/go-tcp-pool","owner":"samber","description":"✨ Drop-in replacement to net.Conn with pooling and auto-reconnect","archived":false,"fork":false,"pushed_at":"2024-11-09T18:03:32.000Z","size":26,"stargazers_count":15,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-09T19:17:48.642Z","etag":null,"topics":["bandwidth","connection","go","parallel","pool","pooling","pressure","reconnect","retry","round-robin","tcp"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/samber/go-tcp-pool","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/samber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["samber"]}},"created_at":"2023-07-23T22:43:41.000Z","updated_at":"2024-11-09T18:02:24.000Z","dependencies_parsed_at":"2023-07-23T23:32:06.431Z","dependency_job_id":"220f30b0-331c-4283-8783-cbc3b6ca355f","html_url":"https://github.com/samber/go-tcp-pool","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"bfba30b2c7d18d6a14d0bbda46695dce595c425e"},"previous_names":["samber/go-tcp-pool"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fgo-tcp-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fgo-tcp-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fgo-tcp-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fgo-tcp-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samber","download_url":"https://codeload.github.com/samber/go-tcp-pool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223888365,"owners_count":17220083,"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":["bandwidth","connection","go","parallel","pool","pooling","pressure","reconnect","retry","round-robin","tcp"],"created_at":"2024-11-09T22:09:15.126Z","updated_at":"2024-11-09T22:09:15.616Z","avatar_url":"https://github.com/samber.png","language":"Go","funding_links":["https://github.com/sponsors/samber"],"categories":[],"sub_categories":[],"readme":"\n# TCP pooling\n\n[![tag](https://img.shields.io/github/tag/samber/go-tcp-pool.svg)](https://github.com/samber/go-tcp-pool/releases)\n![Go Version](https://img.shields.io/badge/Go-%3E%3D%201.18.0-%23007d9c)\n[![GoDoc](https://godoc.org/github.com/samber/go-tcp-pool?status.svg)](https://pkg.go.dev/github.com/samber/go-tcp-pool)\n![Build Status](https://github.com/samber/go-tcp-pool/actions/workflows/test.yml/badge.svg)\n[![Go report](https://goreportcard.com/badge/github.com/samber/go-tcp-pool)](https://goreportcard.com/report/github.com/samber/go-tcp-pool)\n[![Coverage](https://img.shields.io/codecov/c/github/samber/go-tcp-pool)](https://codecov.io/gh/samber/go-tcp-pool)\n[![Contributors](https://img.shields.io/github/contributors/samber/go-tcp-pool)](https://github.com/samber/go-tcp-pool/graphs/contributors)\n[![License](https://img.shields.io/github/license/samber/go-tcp-pool)](./LICENSE)\n\n✨ Drop-in replacement to `net.Conn` with pooling and auto-reconnect.\n\n## 🚀 Install\n\n```sh\ngo get github.com/samber/go-tcp-pool\n```\n\nThis library is v1 and follows SemVer strictly. No breaking changes will be made to exported APIs before v2.0.0.\n\n## 💡 Usage\n\nGoDoc: [https://pkg.go.dev/github.com/samber/go-tcp-pool](https://pkg.go.dev/github.com/samber/go-tcp-pool)\n\n### Create a TCP connection pool\n\n```sh\n# Start a tcp server\nncat -l 9999 -k\n```\n\n```go\nimport pool \"github.com/samber/go-tcp-pool\"\n\nconn, err := pool.Dial(\"tcp\", \"localhost:9999\")\nif err != nil {\n    log.Fatal(err)\n}\n\nconn.SetPoolSize(10)\nconn.SetMaxRetries(10)\nconn.SetRetryInterval(10 * time.Millisecond)\n\n// a tcp connection will be used in a round-robin manner\nn, err := conn.Write([]byte(\"Hello, world!\\n\"))\nif err != nil {\n    log.Fatal(err)\n}\n\n// will always return an error\nconn.Read(...)\n```\n\n## 🚀 @TODO\n\n- [x] Implement round-robin connection pool\n- [x] Implement auto-reconnect\n- [ ] Implement Read()\n- [ ] Implement other load-balancing strategies\n  - Max idle time\n  - MinConn + MaxConn\n\n## 🤝 Contributing\n\n- Ping me on Twitter [@samuelberthe](https://twitter.com/samuelberthe) (DMs, mentions, whatever :))\n- Fork the [project](https://github.com/samber/go-tcp-pool)\n- Fix [open issues](https://github.com/samber/go-tcp-pool/issues) or request new features\n\nDon't hesitate ;)\n\n```bash\n# Install some dev dependencies\nmake tools\n\n# Run tests\nmake test\n# or\nmake watch-test\n```\n\n## 👤 Contributors\n\n![Contributors](https://contrib.rocks/image?repo=samber/go-tcp-pool)\n\n## 💫 Show your support\n\nGive a ⭐️ if this project helped you!\n\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/samber?style=for-the-badge)](https://github.com/sponsors/samber)\n\n## 📝 License\n\nCopyright © 2023 [Samuel Berthe](https://github.com/samber).\n\nThis project is [MIT](./LICENSE) licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamber%2Fgo-tcp-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamber%2Fgo-tcp-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamber%2Fgo-tcp-pool/lists"}