项目作者: jitesoft

项目描述 :
Simple application to healthcheck http endpoints.
高级语言: Makefile
项目地址: git://github.com/jitesoft/http-healthcheck.git
创建时间: 2019-09-26T16:22:46Z
项目社区:https://github.com/jitesoft/http-healthcheck

开源协议:MIT License

下载


Http-HealthCheck

A simple program written in Go to allow healtchecks against a http endpoint.
To pass URI to the target, supply the uri as the first argument on invocation:

  1. ./http-healtcheck https://jitesoft.com

In case the page have an error (500) the call will exit with exit code 1, in case it does not have a 500 error, it will
exit with exit code 0.
To specify a specific set of acceptable status codes, supply a go-compatible regular expression as the second argument:

  1. ./http-healtcheck https://jitesoft.com [2]{1}[0-9]{2} # Only accept 2xx responses!

The default regexp test is: [2-4]{1}[0-9]{2} which allows for any 2xx - 4xx page (just checking so that the server responds on http queries).

Development

Clone, there are no dependencies, so just go!

Building

The supplied makefile will (by invoking docker) build the binaries for linux, windows and darwin. The linux and darwin
binaries are only built in amd64 version, while the linux binaries are built for amd64, arm64, ppc64le, s390x and 386 for
both standard linux and linux distros using musl (like alpine linux). Binaries will be placed in the bin directory
gzipped and ready for release! They are named as following: http-healthcheck-<OS>(-musl)-<ARCH>.tar.gz.

Examples:

  1. bin/http-healthcheck-windows-amd64.tar.gz
  2. bin/http-healthcheck-linux-arm64.tar.gz
  3. bin/http-healthcheck-linux-musl-s390x.tar.gz
  4. bin/http-healthcheck-dawrin-amd64.tar.gz