tcp

package
v0.0.0-...-efbc44a Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package tcp is the TCP_CHECK health check: connect to the backend, and treat a completed connection as healthy.

It is the simplest of the checker types and the one the others build on — HTTP, SMTP and DNS all begin with the same connection and then talk further.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	Opts layer4.Options
}

Checker performs a TCP connection check.

func New

func New(opts layer4.Options, timeout time.Duration) Checker

New returns a checker for an address, with the given connect timeout.

func (Checker) Check

func (c Checker) Check(ctx context.Context) (layer4.Result, error)

Check performs one connection attempt.

The connection is closed immediately: TCP_CHECK asks only whether the backend will accept one. Holding it open would leave a connection per check per backend accumulating in the backend's table for no benefit.

Jump to

Keyboard shortcuts

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