[!IMPORTANT]
This healthcheck client is only compatible with Windows and Linux operating
systems
[!NOTE]
The term socket is used throughout the documentation as a synonym for the
named pipes provided by Windows to improve readability
About
This package supplies the healthcheck client from the github.com/wisdom-oss/go-healthcheck
package.
On Linux operating systems, the client uses the unix
network and sockets to
achieve inter-process communication with the client.
Since the unix
network and sockets are not available under Windows, the client
uses named pipes from the Windows IPC API using the go-winio
module.
Configuring
Socket Name
Since the server generates the socket name automatically, the client will try
to pick up the socket name from the .hc-socket
file.
Usage
To allow a seamless function of the healthcheck client, it only needs to be
imported for its side effects using the following import statement
import _ github.com/wisdom-oss/go-healthcheck/client
Since the client uses a init()
function to determine if the healthcheck should
be requested this is the only thing you need to do.
Afterward you may call your executable with the -healthcheck
flag which will
trigger the healthcheck request.
Since the targeted use case for the client is a docker container running
automatic healthchecks, the response buffer size is limited to 4096 bytes as
this is the number of output bytes kept by Docker after a health check