Help us shape the future of Go! Take the 2026 Go Developer Survey

responder

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package responder answers haproxy agent-check probes over TCP: read one newline-terminated agent-send identity, write one reply line, close. Reply grammar: https://docs.haproxy.org/2.8/configuration.html#5.2-agent-check

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr       string
	Store      Lookup
	Logger     *slog.Logger
	Registerer prometheus.Registerer

	// Timeout bounds each connection. It must stay well below haproxy's
	// check timeout.
	Timeout time.Duration
}

type Lookup

type Lookup interface {
	Synced() bool
	Lookup(identity string) (state string, found bool)
}

Lookup is the read side of the state store.

type Responder

type Responder struct {
	// contains filtered or unexported fields
}

Responder is the TCP listener answering agent checks.

func New

func New(cfg Config) *Responder

func (*Responder) Addr

func (r *Responder) Addr() string

Addr returns the bound listener address, or "" before Start.

func (*Responder) Name

func (r *Responder) Name() string

func (*Responder) Shutdown

func (r *Responder) Shutdown(ctx context.Context) error

func (*Responder) Start

func (r *Responder) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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