{"id":30620976,"url":"https://github.com/dector/nettw","last_synced_at":"2025-08-30T14:12:43.643Z","repository":{"id":304673838,"uuid":"1019523383","full_name":"dector/nettw","owner":"dector","description":"Small network-related utilities for Go","archived":false,"fork":false,"pushed_at":"2025-07-14T14:09:37.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"trunk","last_synced_at":"2025-08-14T21:58:17.630Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dector.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-07-14T13:08:16.000Z","updated_at":"2025-07-14T14:09:20.000Z","dependencies_parsed_at":"2025-07-14T18:19:40.898Z","dependency_job_id":"de892775-37ed-4eb7-8190-6c504ae9a98a","html_url":"https://github.com/dector/nettw","commit_stats":null,"previous_names":["dector/nettw"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dector/nettw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dector%2Fnettw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dector%2Fnettw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dector%2Fnettw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dector%2Fnettw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dector","download_url":"https://codeload.github.com/dector/nettw/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dector%2Fnettw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272858542,"owners_count":25005092,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-08-30T14:12:43.167Z","updated_at":"2025-08-30T14:12:43.636Z","avatar_url":"https://github.com/dector.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nettw\n\nSmall network-oriented Go library.\n\n## Installation\n\n```bash\ngo get github.com/dector/nettw\n```\n\n## Usage\n\n### Get available port (preferebly user-specified)\n\nUse `ParsePortOrPickAnother()`:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/dector/nettw\"\n)\n\nfunc main() {\n    port, err := nettw.ParsePortOrPickAnother(\"8080\")\n    if err != nil {\n        panic(err)\n    }\n\n    // If port 8080 free - we will get it here.\n    // If not - random free port will be returned.\n    fmt.Printf(\"Using port: %d\\n\", port.Int)\n}\n```\n\n### Getting a Port with Custom Arguments\n\nUse `ParsePortOrPickAnotherWithArgs()`:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/dector/nettw\"\n)\n\nfunc main() {\n    port, err := nettw.ParsePortOrPickAnotherWithArgs(\n        \"8080\",\n        nettw.ParsePortArgs{\n            NewPortFrom:       3000,\n            NewPortTo:         4000,\n            MaxTries:          50,\n        }\n    )\n    if err != nil {\n        panic(err)\n    }\n\n    fmt.Printf(\"Using port: %d\\n\", port.Int)\n}\n```\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdector%2Fnettw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdector%2Fnettw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdector%2Fnettw/lists"}