hareply

command module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 7 Imported by: 0

README

hareply

hareply is a tool that replies to HAProxy's agent-check that replies with the contents of a given file.

CLI usage

# Print help
hareply -h

# Print help for serve command
hareply serve -h

# Print version information
hareply version

# Serve from port 8020 and a specific path.
hareply serve -f /some/path/to/agentstate -p 8020

# Serve from port 8442 and filepath `agentstate` (the defaults).
hareply serve

As a library

hareply can also be used as a library, see the godoc for the hareply package.

Error handling

  • The response "agentstate" file is read on startup, if that fails the program will exit.
  • The file is read again on any TCP connection, if that fails the last known file contents are used.
  • If the value in the file is not a valid response for agent-check, the last valid response is returned instead.

Release

Releases are built using goreleaser, see the goreleaser.yml file.

To mint a (test) release locally, install goreleaser and run

goreleaser --snapshot --skip=publish --clean

License

MIT 🎶.

Documentation

Overview

Package main contains the main function for the hareply CLI.

Directories

Path Synopsis
Package buildinfo implements build information, injected by goreleaser.
Package buildinfo implements build information, injected by goreleaser.
Package cmd contains the CLI implementation for hareply.
Package cmd contains the CLI implementation for hareply.

Jump to

Keyboard shortcuts

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