{"id":37294839,"url":"https://github.com/planetscale/cloudranger","last_synced_at":"2026-04-06T17:01:20.874Z","repository":{"id":209333681,"uuid":"723774422","full_name":"planetscale/cloudranger","owner":"planetscale","description":"Go library for mapping IP address ranges to cloud provider regions (currently: AWS and GCP)","archived":false,"fork":false,"pushed_at":"2026-03-30T04:27:16.000Z","size":4747,"stargazers_count":23,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-30T06:51:09.272Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/planetscale.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-26T18:11:32.000Z","updated_at":"2026-03-23T04:17:46.000Z","dependencies_parsed_at":"2026-01-05T19:02:39.403Z","dependency_job_id":null,"html_url":"https://github.com/planetscale/cloudranger","commit_stats":null,"previous_names":["planetscale/cloudranger"],"tags_count":142,"template":false,"template_full_name":null,"purl":"pkg:github/planetscale/cloudranger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fcloudranger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fcloudranger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fcloudranger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fcloudranger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/planetscale","download_url":"https://codeload.github.com/planetscale/cloudranger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fcloudranger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31481238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T14:34:32.243Z","status":"ssl_error","status_checked_at":"2026-04-06T14:34:31.723Z","response_time":112,"last_error":"SSL_read: 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":[],"created_at":"2026-01-16T02:36:15.743Z","updated_at":"2026-04-06T17:01:20.862Z","avatar_url":"https://github.com/planetscale.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# cloudranger\n\n`cloudranger` is a Go library designed to identify cloud provider information from IP addresses, with current support for AWS and GCP.\n\nIt functions without any external runtime dependencies, as IP range data is stored internally. Meant for high throughput, low-latency environments, `cloudranger` also focuses on rapid startup, loading in under 4ms. You can verify this on your system by running `make bench` and checking the `BenchmarkNew` results.\n\nNew releases are automatically created in response to updates in cloud providers' IP range information. This process, facilitated through GitHub Actions, is executed weekly to ensure the library remains up-to-date.\n\nThe inspiration for `cloudranger` came from a similar library found at https://github.com/kubernetes/registry.k8s.io, used by the Kubernetes OCI registry for redirecting requests to the appropriate cloud provider. We developed `cloudranger` to provide a standalone library adaptable for various projects, offering greater control for our specific use cases and minimizing the impact of upstream changes. Unlike the original project, which uses its own trie implementation, `cloudranger` depends on github.com/infobloxopen/go-trees. While both implementations have not been directly benchmarked against each other, their performance is expected to be comparable.\n\n## Usage\n\n```sh\ngo get github.com/planetscale/cloudranger\n```\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/planetscale/cloudranger\"\n)\n\nfunc main() {\n\tranger := cloudranger.New()\n\tipinfo, found := ranger.GetIP(\"3.5.140.101\")\n\tif found {\n\t\tfmt.Printf(\"cloud: %s, region: %s\\n\", ipinfo.Cloud(), ipinfo.Region())\n\t}\n}\n```\n\nA small cli is included in [cmd/cloudranger](cmd/cloudranger). It is EXPERIMENTAL and its behavior, flags, and output is likely to change.\n\n```sh\n$ go run cmd/cloudranger/main.go 3.5.140.101\n\n{\"cloud\":\"AWS\",\"region\":\"ap-northeast-2\"}\n```\n\n## Testing and Benchmarks\n\n```sh\nmake lint\nmake test\nmake bench\n```\n\n```\ngoos: linux\ngoarch: amd64\npkg: github.com/planetscale/cloudranger\ncpu: AMD EPYC 7B12\n\nBenchmarkNew-16              396           3153591 ns/op         1084213 B/op      26089 allocs/op\nBenchmarkGetIP-16        6268292               194.8 ns/op            64 B/op          2 allocs/op\n```\n\n## IP Range Database Updates\n\nIP range data is sourced from:\n\n- AWS: https://ip-ranges.amazonaws.com/ip-ranges.json\n- GCP: https://www.gstatic.com/ipranges/cloud.json\n\nA GitHub Actions workflow is run weekly to update the IP range data if changed by the supported cloud providers. A new version is created and tagged if changes are detected. Use dependabot or renovate to automate updates to the latest version.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetscale%2Fcloudranger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplanetscale%2Fcloudranger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetscale%2Fcloudranger/lists"}