{"id":49467669,"url":"https://github.com/rasmushs/week2-http-health-checker","last_synced_at":"2026-04-30T13:03:19.175Z","repository":{"id":349599373,"uuid":"1202035802","full_name":"RasmusHS/Week2-HTTP-Health-Checker","owner":"RasmusHS","description":"Week 2 of a 12 week 1 project per week plan ","archived":false,"fork":false,"pushed_at":"2026-04-06T17:31:42.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-06T19:14:26.144Z","etag":null,"topics":["concurrency","go","goroutines","http","learning-by-doing","learning-project","multithreading"],"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/RasmusHS.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-05T14:08:06.000Z","updated_at":"2026-04-06T17:31:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/RasmusHS/Week2-HTTP-Health-Checker","commit_stats":null,"previous_names":["rasmushs/week2-http-health-checker"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/RasmusHS/Week2-HTTP-Health-Checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RasmusHS%2FWeek2-HTTP-Health-Checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RasmusHS%2FWeek2-HTTP-Health-Checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RasmusHS%2FWeek2-HTTP-Health-Checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RasmusHS%2FWeek2-HTTP-Health-Checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RasmusHS","download_url":"https://codeload.github.com/RasmusHS/Week2-HTTP-Health-Checker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RasmusHS%2FWeek2-HTTP-Health-Checker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32465008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"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":["concurrency","go","goroutines","http","learning-by-doing","learning-project","multithreading"],"created_at":"2026-04-30T13:03:15.097Z","updated_at":"2026-04-30T13:03:19.167Z","avatar_url":"https://github.com/RasmusHS.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTTP Health Checker\nThis project is the 2nd in my 12 weeks 12 projects plan. [Overview](https://github.com/RasmusHS/12-Weeks-of-Coding) \\\nA concurrent command-line tool written in Go that continuously monitors the health of a list of URLs. It performs HTTP GET requests in parallel, reports status codes, response times, and up/down status in a formatted table, and repeats on a configurable interval.\n\n## Features\n\n- **Concurrent checks** — URLs are checked in parallel using goroutines, with a concurrency limit of 10 to avoid overwhelming the system.\n- **Configurable interval** — Set the check interval via the `-interval` flag (default: 60 seconds).\n- **Live countdown** — Displays a real-time countdown until the next check cycle.\n- **Formatted output** — Results are displayed in an aligned table showing URL, status code, response time, and up/down status.\n- **Graceful exit** — Press Enter at any time during the countdown to stop the program.\n- **Status classification** — Differentiates between UP (2xx), REDIRECT (3xx), client errors (4xx), server errors (5xx), and connection failures.\n\n## Project Structure\n\n| File         | Purpose                                    |\n|--------------|--------------------------------------------|\n| `main.go`    | Entry point, orchestration, and check loop |\n| `checker.go` | HTTP checking logic (5s timeout per URL)   |\n| `config.go`  | JSON config file loading and parsing       |\n| `result.go`  | Result struct and table output formatting  |\n| `urls.json`  | List of URLs to monitor                    |\n\n## Getting Started\n\n### Prerequisites\n\n- [Go](https://go.dev/dl/) 1.26+\n\n### Installation\n\n```bash\ngit clone \u003crepository-url\u003e\ncd \"HTTP Health Checker\"\ngo build -o health-checker .\n```\n\n### Configuration\nEdit urls.json to specify the URLs you want to monitor:\n```json\n\"urls\": [\n    \"https://www.example.com\",\n    \"https://www.google.com\",\n    \"https://www.github.com\"\n  ]\n```\n\n### Usage\n\n```sh\n# Run with default 60-second interval\ngo run .\n\n# Run with a custom interval (e.g., 30 seconds)\ngo run . -interval 30\n```\n\n## Example Output\n\u003c!-- |---|---|---|---| --\u003e\n```bash\nURL                            | Status | Response Time | Up/Down Status\nhttps://www.google.com         | 200    | 150ms         | UP\nhttps://www.example.com        | 200    | 85ms          | UP\nhttps://www.badurl.invalid     | ---    | ---           | DOWN (error: ...)\n\nNext check in 60 seconds... Press Enter to exit.\nTime remaining: 47 seconds\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasmushs%2Fweek2-http-health-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frasmushs%2Fweek2-http-health-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasmushs%2Fweek2-http-health-checker/lists"}