{"id":16443336,"url":"https://github.com/arxdsilva/thresh","last_synced_at":"2026-04-16T18:45:06.584Z","repository":{"id":57607001,"uuid":"125049651","full_name":"arxdsilva/thresh","owner":"arxdsilva","description":"[LIB] Check multiple endpoints states and get notified","archived":false,"fork":false,"pushed_at":"2018-10-03T01:49:03.000Z","size":987,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T18:34:26.507Z","etag":null,"topics":["alert","go","golang","healthcheck","json","library"],"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/arxdsilva.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}},"created_at":"2018-03-13T12:41:14.000Z","updated_at":"2018-10-03T01:48:56.000Z","dependencies_parsed_at":"2022-08-30T08:51:24.265Z","dependency_job_id":null,"html_url":"https://github.com/arxdsilva/thresh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arxdsilva%2Fthresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arxdsilva%2Fthresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arxdsilva%2Fthresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arxdsilva%2Fthresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arxdsilva","download_url":"https://codeload.github.com/arxdsilva/thresh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240795005,"owners_count":19858725,"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":["alert","go","golang","healthcheck","json","library"],"created_at":"2024-10-11T09:20:08.803Z","updated_at":"2026-04-16T18:45:01.545Z","avatar_url":"https://github.com/arxdsilva.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/arxdsilva/thresh?status.png)](https://godoc.org/github.com/arxdsilva/thresh)\n[![Travis Build Status](https://api.travis-ci.org/arxdsilva/thresh.svg?branch=master)](https://travis-ci.org/arxdsilva/thresh)\n[![Coverage Status](https://coveralls.io/repos/github/arxdsilva/thresh/badge.svg?branch=master)](https://coveralls.io/github/arxdsilva/thresh?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/arxdsilva/thresh)](https://goreportcard.com/report/github.com/arxdsilva/thresh)\n[![LICENSE](https://img.shields.io/badge/license-MIT-orange.svg)](LICENSE)\n\n# Table of contents\n1. [About Thresh](https://github.com/arxdsilva/thresh#about-thresh)\n2. [Usage](https://github.com/arxdsilva/thresh#usage)\n3. [Example](https://github.com/arxdsilva/thresh#example)\n4. [License](https://github.com/arxdsilva/thresh#license)\n\n# About Thresh\n\u003cimg src=\"thresh.jpg\" alt=\"Drawing\" height=\"200px\"/\u003e\n\nLibrary that allows you to use a healthcheck route as a checker for other routes/APIs. This was made to keep checking the size of a channel that is returned in a route, but it's open enought to serve your own porpuse.\n\n# Usage\n\nThresh idea is to provide inside look of what might be happening to one or more of the routes of your app or an external app. It does It by getting a list of urls that you want to parse from a environment variable named `ADDRS` with the following format of value: `myurl1,myurl2,myurl3`. \n\nThe way to implement after setting this environment variable is explicited in the following section [example](https://github.com/arxdsilva/thresh#example).\n\n# [Example](https://github.com/arxdsilva/thresh/tree/master/example)\n\nThis is a simple example of a implementation in a handler, you can find the full source code [here](https://github.com/arxdsilva/thresh/tree/master/_example).\n\n```golang\n\ntype SomeStruct struct {\n\tValue int\n}\n\nfunc HealthCheck(c echo.Context) (err error) {\n\tgo func() {\n\t\taddrs, err := thresh.Addrs()\n\t\tif err != nil {\n\t\t\t// log err somewhere\n\t\t}\n\t\tfor _, ad := range addrs {\n\t\t\tp := new(thresh.Ping)\n\t\t\tp.Addr = ad\n\t\t\t// pass some structure\n\t\t\tstr := new(SomeStruct)\n\t\t\terr = p.StartAddr(str)\n\t\t\tif err != nil {\n\t\t\t\t// log err somewhere\n\t\t\t}\n\t\t\t// create a checker function\n\t\t\t// to your structure\n\t\t\tCheckFields(str, p)\n\t\t\t// [WIP] this will warn \n\t\t\t// your slack channel\n\t\t\tp.CheckStatus()\n\t\t}\n\t}()\n\treturn c.String(http.StatusOK, \"OK\")\n}\n\nfunc CheckFields(s *SomeStruct, p *thresh.Ping) {\n\tif s.Value \u003e 100 {\n\t\tp.Status = true\n\t}\n}\n\n```\n\n# License\n\nThresh is [MIT License](https://github.com/arxdsilva/thresh/blob/master/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farxdsilva%2Fthresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farxdsilva%2Fthresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farxdsilva%2Fthresh/lists"}