client

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2024 License: EUPL-1.2 Imports: 8 Imported by: 0

README

Healthcheck Client

go-healthcheck

🫀Healthcheck client for microservices

Go Lang Version Go Reference

[!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

Documentation

Overview

Package client provides a client which automatically detects the healthcheck server and connects itself to the healthcheck server and triggers the healthcheck and awaits the results.

## Usage

import _ "github.com/wisdom-oss/go-healthcheck/client"

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL