HCio is a straightforward way to ping Healthchecks.io checks directly from a Go application

HCio

HCio is a straightforward way to ping Healthchecks.io checks directly from a Go application.

Getting Started

Create a simple Check:

check := hcio.NewCheck("460a896b-e5e7-4d4a-996b-5ea0f3533a16")

To update the status of the check use the relevant status method:

// success
check.Ping()
check.Success()

// failure
check.Fail()

// or a specific error code (0-255 only)
check.FailCode(51)

You can also time a longer operation and indicate success or failure as needed:

// indicate the operation is starting
check.Start()

// do the real work
time.Sleep(30 * time.Second)

// indicate everything worked out just fine
check.Success()

You can also check a few options from the defaults

check := hcio.NewCheck("460a896b-e5e7-4d4a-996b-5ea0f3533a16", hcio.Options{
	// the URL of the pinging API server, default is "https://hc-ping.com/"
	BaseUrl: "https://my-private-instance/",
	
	// the number of retries in the event of an HTTP failure, default is 3, must be over 0
	MaxRetries: 5,

	// the user agent to send with the requests, defaults to the Go standard user agent
	UserAgent: "mytool/0.1.0",
})

License

HCio is open-source software released under the MIT License.

Similar Resources

Minecraft Server List Ping library written in Go

minequery Minecraft Server List Ping library written in Go. Features Modern Mine

Dec 28, 2022

Vmessping - A ping prober for vmess:// links in common seen formats

VMessPing A ping prober for vmess:// links in common seen formats. vmessping sup

Jan 9, 2022

QUIC-PING: A UDP client for sending QUIC PINGs.

QUIC-PING A UDP client for sending "QUIC PING"s. What is a QUIC PING? A QUIC Initial packet with random payload and the version 0xbabababa to force Ve

Dec 14, 2022

Connect directly to Docker-for-Mac containers via IP address 🐳 💻

Connect directly to Docker-for-Mac containers via IP address 🐳 💻

Docker Mac Net Connect Connect directly to Docker-for-Mac containers via IP address. Features L3 connectivity: Connect to Docker containers from macOS

Jan 5, 2023

Library for directly interacting and controlling an Elgato Stream Deck on Linux.

Stream Deck Library for directly interacting and controlling an Elgato Stream Deck on Linux. This library is designed to take exclusive control over a

Dec 17, 2022

bodyclose is a static analysis tool which checks whether res.Body is correctly closed.

bodyclose is a static analysis tool which checks whether res.Body is correctly closed. Install You can get bodyclose by go get command. $ go

Jan 6, 2023

checkip is a CLI tool and library that checks an IP address using various public services.

checkip is a CLI tool and library that checks an IP address using various public services.

checkip is a CLI tool and library that checks an IP address using various public services.

Dec 20, 2022

Bodyclose: a static analysis tool which checks whether res.Body is correctly closed

bodyclose bodyclose is a static analysis tool which checks whether res.Body is correctly closed. Install You can get bodyclose by go get command. $ go

Dec 9, 2021

Checks sneaker availability, currently Asos/JD/Nike + Air Force 1 '07 44 only

airforce Setup Requires a .env file with Twilio credentials and phone numbers. SID=AC0ae6d46612d3a0c3d49977485652f665 TOKEN=7ff8d07a7d0fc9e6432a14ad84

Dec 12, 2021
Related tags
This small Docker project is the easiest way to send notifications directly via .txt files to services like: Gotify, Telegram, SMTP (Email) or Webhook.
This small Docker project is the easiest way to send notifications directly via .txt files to services like: Gotify, Telegram, SMTP (Email) or Webhook.

This small Docker project is the easiest way to send notifications directly via .txt files to services like: Gotify, Telegram, SMTP (Email) or Webhook.

Oct 5, 2022
ping 和 http get 请求探测 适配 nightingale

n9e-probe 功能 ping 和 http get 请求探测 适配 nightingale 指标 ping metric 说明 ping.latency ping 请求的延迟,单位是毫秒。-1 表示 ping 不通 tag 说明 ip 探测的目标 ip region 如果配置了,则插入 reg

Sep 27, 2022
🚥 Yet another pinger: A high-performance ICMP ping implementation build on top of BPF technology.

yap Yet-Another-Pinger: A high-performance ICMP ping implementation build on top of BPF technology. yap uses the gopacket library to receive and handl

Nov 9, 2022
DNS Ping: to check packet loss and latency issues with DNS servers

DNSping DNS Ping checks packet loss and latency issues with DNS servers Installation If you have golang, easiest install is go get -u fortio.org/dnspi

Nov 18, 2022
[FORK] ICMP Ping library for Go

forked from go-ping/ping go get -u github.com/gandaldf/ping go-ping A simple but powerful ICMP echo (ping) library for Go, inspired by go-fastping. He

Oct 21, 2021
Prometheus exporter for ping metrics such as RTT, packet loss, and jitter to any number of hosts.

ping_exporter Command ping_exporter provides a Prometheus exporter for ping metrics such as RTT, packet loss, and jitter to any number of hosts. Usage

Sep 24, 2022
Ping library for Golang with multi-host support

pingo Fast and lightweight ping library for Golang with multi-host support. Features ICMP sockets: UDP port 0 means "let the kernel pick a free number

Nov 9, 2022
A little ping pong service that implements rate limiting with golang

Fred the Guardian Introduction Writing a little ping pong service that implements rate limiting with the programming language golang. Requirements Web

Jan 2, 2022
Implementation of Minecraft protocols : ping, query and icon.
Implementation of Minecraft protocols : ping, query and icon.

mcutils - Implementation of Minecraft protocols in Go Informations General All protocols are implemented in Go, without any external dependency. All p

Dec 19, 2022
PinGo is a standalone and feature-rich tool for common IP-based reachability checking tasks. Ping or Trace and Observe in real-time the statistics.

pingo As a network champion from designing and implementing to troubleshooting large scale networks - I know that is usually not easy for administrato

Sep 26, 2022