An open API service indexing awesome lists of open source software.

https://github.com/dev-shimada/http-health-probe


https://github.com/dev-shimada/http-health-probe

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

          

# http-health-probe

[![Go Report Card](https://goreportcard.com/badge/github.com/dev-shimada/http-health-probe)](https://goreportcard.com/report/github.com/dev-shimada/http-health-probe)
[![CI](https://github.com/dev-shimada/http-health-probe/actions/workflows/CI.yaml/badge.svg)](https://github.com/dev-shimada/http-health-probe/actions/workflows/CI.yaml)
[![Coverage Status](https://coveralls.io/repos/github/dev-shimada/http-health-probe/badge.svg?branch=main)](https://coveralls.io/github/dev-shimada/http-health-probe?branch=main)
[![License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/dev-shimada/http-health-probe/blob/master/LICENSE)

http-health-probeは、HTTPベースのAPIのヘルスチェックを行うためのシンプルなコマンドラインツールです。

## ✨ 特徴

- C言語のライブラリ不要(Goのみで実装)
- distrolessイメージで動作可能
- シンプルなコマンドラインインターフェース

## 📦 インストール

### バイナリダウンロード

リリースページから各プラットフォーム向けのバイナリをダウンロードしてください。
```shell
INSTALL_DIR=/tmp
VERSION=v0.1.1
TARGETOS=Linux
TARGETARCH=arm64
curl --silent --location https://github.com/dev-shimada/http-health-probe/releases/download/${VERSION}/http-health-probe_${TARGETOS}_${TARGETARCH}.tar.gz | tar xvz -C ${INSTALL_DIR} --one-top-level=http-health-probe_${TARGETOS}_${TARGETARCH}
```

### go install

```shell
go install github.com/dev-shimada/http-health-probe
```

## 🚀 使い方

### コマンド例

```shell
http-health-probe --addr=http://localhost:8080/healthcheck
```

### ⚙️ 主要オプション

| オプション | 説明 | デフォルト値 |
| ------------------- | ----------------------------------- | ------------------- |
| `--addr` | チェック対象のHTTPエンドポイントURL | なし(必須) |
| `--method` | HTTPメソッド | `GET` |
| `--timeout` | リクエストのタイムアウト | `1s` |
| `--expected-status` | 正常と判断するHTTPステータスコード | `200` |
| `--tls` | TLSを使用する | `false` |
| `--insecure` | TLS証明書の検証をスキップする | `false` |
| `--user-agent` | User-Agentヘッダー | `http-health-probe` |

## 🐳 distrolessイメージでの利用例

```Dockerfile
FROM rust:bookworm AS build
ARG TARGETOS
ARG TARGETARCH
RUN <