{"id":15065990,"url":"https://github.com/kazhuravlev/healthcheck","last_synced_at":"2025-04-10T13:35:08.081Z","repository":{"id":243415757,"uuid":"812340558","full_name":"kazhuravlev/healthcheck","owner":"kazhuravlev","description":"Readiness probes for Kubernetes application","archived":false,"fork":false,"pushed_at":"2024-12-17T21:13:42.000Z","size":88,"stargazers_count":13,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T06:15:50.680Z","etag":null,"topics":["go","golang","k8s","kubernetes","readiness","readiness-probe"],"latest_commit_sha":null,"homepage":"","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/kazhuravlev.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-08T15:59:45.000Z","updated_at":"2024-12-17T21:12:56.000Z","dependencies_parsed_at":"2024-08-14T17:53:34.692Z","dependency_job_id":null,"html_url":"https://github.com/kazhuravlev/healthcheck","commit_stats":null,"previous_names":["kazhuravlev/healthcheck"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazhuravlev%2Fhealthcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazhuravlev%2Fhealthcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazhuravlev%2Fhealthcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazhuravlev%2Fhealthcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kazhuravlev","download_url":"https://codeload.github.com/kazhuravlev/healthcheck/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225878,"owners_count":21068079,"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":["go","golang","k8s","kubernetes","readiness","readiness-probe"],"created_at":"2024-09-25T00:59:08.081Z","updated_at":"2025-04-10T13:35:08.054Z","avatar_url":"https://github.com/kazhuravlev.png","language":"Go","funding_links":[],"categories":["Utilities","公用事业公司"],"sub_categories":["Utility/Miscellaneous","实用程序/Miscellaneous"],"readme":"# Healthcheck for go applications\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/kazhuravlev/healthcheck.svg)](https://pkg.go.dev/github.com/kazhuravlev/healthcheck)\n[![License](https://img.shields.io/github/license/kazhuravlev/healthcheck?color=blue)](https://github.com/kazhuravlev/healthcheck/blob/master/LICENSE)\n[![Build Status](https://github.com/kazhuravlev/healthcheck/actions/workflows/tests.yml/badge.svg)](https://github.com/kazhuravlev/healthcheck/actions/workflows/tests.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/kazhuravlev/healthcheck)](https://goreportcard.com/report/github.com/kazhuravlev/healthcheck)\n[![CodeCov](https://codecov.io/gh/kazhuravlev/healthcheck/branch/master/graph/badge.svg?token=tNKcOjlxLo)](https://codecov.io/gh/kazhuravlev/healthcheck)\n\nThis tools allow you to unlock the kubernetes\nfeature [Liveness and Readiness](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/).\n\n## Features\n\n- Logger to log failed probes\n- Automatic, manual and background checks\n- Respond with all healthchecks status in JSON format\n- Callback for integrate with metrics or other systems\n- Integrated web server\n\n## Quickstart\n\n```shell\ngo get -u github.com/kazhuravlev/healthcheck\n```\n\nCheck an [examples](./examples/example.go).\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"math/rand\"\n\t\"time\"\n\n\t\"github.com/kazhuravlev/healthcheck\"\n)\n\nfunc main() {\n\tctx := context.TODO()\n\n\t// 1. Init healthcheck instance. It will store all our checks.\n\thc, _ := healthcheck.New()\n\n\t// 2. Register checks that will random respond with an error.\n\thc.Register(ctx, healthcheck.NewBasic(\"redis\", time.Second, func(ctx context.Context) error {\n\t\tif rand.Float64() \u003e 0.5 {\n\t\t\treturn errors.New(\"service is not available\")\n\t\t}\n\n\t\treturn nil\n\t}))\n\n\t// 3. Init and run a webserver for integration with Kubernetes.\n\tsysServer, _ := healthcheck.NewServer(hc, healthcheck.WithPort(8080))\n\t_ = sysServer.Run(ctx)\n\n\t// 4. Open http://localhost:8080/ready to check the status of your system\n\tselect {}\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazhuravlev%2Fhealthcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkazhuravlev%2Fhealthcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazhuravlev%2Fhealthcheck/lists"}