{"id":26289597,"url":"https://github.com/movableink/sre-assignment-golang","last_synced_at":"2026-04-14T17:32:10.994Z","repository":{"id":279509317,"uuid":"938108459","full_name":"movableink/sre-assignment-golang","owner":"movableink","description":"This repository contains a bare-bones Golang HTTP service template that's part of the Studio SRE take home assignment.","archived":false,"fork":false,"pushed_at":"2025-02-25T23:20:32.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-19T04:24:09.542Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/movableink.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}},"created_at":"2025-02-24T12:41:31.000Z","updated_at":"2025-02-25T23:20:34.000Z","dependencies_parsed_at":"2025-02-26T00:28:27.118Z","dependency_job_id":null,"html_url":"https://github.com/movableink/sre-assignment-golang","commit_stats":null,"previous_names":["movableink/sre-assignment-golang"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/movableink/sre-assignment-golang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movableink%2Fsre-assignment-golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movableink%2Fsre-assignment-golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movableink%2Fsre-assignment-golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movableink%2Fsre-assignment-golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/movableink","download_url":"https://codeload.github.com/movableink/sre-assignment-golang/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movableink%2Fsre-assignment-golang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31808505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2025-03-14T23:15:13.363Z","updated_at":"2026-04-14T17:32:10.965Z","avatar_url":"https://github.com/movableink.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GeoIP Service\n\nA Go-based service that provides geographical information for IP addresses using the Movable Ink GeoIP API.\n\n## Prerequisites\n\n- Go 1.21 or higher\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/movableink/sre-assignment-golang.git\ncd sre-assignment-golang\n```\n\n2. Install dependencies:\n```bash\ngo mod download\n```\n\n## Configuration\n\nThe service requires the following environment variables:\n\n- `API_URL`: The base URL for the Movable Ink GeoIP API (default: http://localhost:8000). A production URL will be provided by Movable Ink.\n- `API_TOKEN`: Your API token for authentication with the Movable Ink GeoIP API. This is required for production use.\n- `PORT`: The port number for the service (default: 3000)\n\n## Running the Service\n\nBuild and start the service (don't forget to set your environment variables before starting):\n```bash\ngo build -o server ./cmd/server\n./server\n```\n\nThe service will be available at `http://localhost:3000`.\n\n## API Endpoints\n\n### GET /lookup/:ip\n\nReturns geographical information for the specified IP address.\n\nExample request:\n```bash\ncurl http://localhost:3000/lookup/8.8.8.8\n```\n\nExample successful response:\n```json\n{\n  \"ip\": \"8.8.8.8\",\n  \"location\": \"United States\",\n  \"postal_code\": \"\",\n  \"network_name\": \"AS15169 GOOGLE\",\n  \"domain\": \"Google\",\n  \"latitude\": 37.751,\n  \"longitude\": -97.822\n}\n```\n\nExample error response (500 Internal Server Error):\n```json\n{\n  \"error\": \"API request failed: \u003cerror details\u003e\"\n}\n```\n\n## Testing\n\n### IP Address Testing Script\n\nThe repository includes a bash script (`test-ips.sh`) that tests the service with a list of IP addresses from `test_ips.txt`. If test_ips.txt is not available you can create your own file and enter an ip address per line for testing. For the assignment the test_ips.txt file will be provided by Movable Ink.\n\nTo run the tests:\n\n1. Make sure the service is running in one terminal:\n```bash\n./server\n```\n\n2. In another terminal, run the test script:\n```bash\n./test-ips.sh\n```\n\nThe script will:\n- Process each IP address in `test_ips.txt`\n- Show progress every 100 requests\n- Display a summary including:\n  - Total number of requests\n  - Total time taken\n  - Average requests per second\n  - Distribution of HTTP status codes\n\n## Project Structure\n\n- `cmd/server/`: Main application entry point\n  - `main.go`: Server implementation\n- `internal/`: Internal packages\n  - `config/`: Configuration management\n  - `geoip/`: GeoIP service implementation\n- `go.mod`: Go module definition and dependencies\n- `test-ips.sh`: Testing script\n\n## License\n\nThis project is proprietary and confidential to Movable Ink.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmovableink%2Fsre-assignment-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmovableink%2Fsre-assignment-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmovableink%2Fsre-assignment-golang/lists"}