tcp

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultConnectionTimeout is the default connection timeout duration
	DefaultConnectionTimeout = 3 * time.Second
)

Variables

This section is empty.

Functions

func New

func New(address string, opts ...Option) checker.Checker

New creates the TCP checker

Types

type Option

type Option func(t *TCP)

Option configures a TCP.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout configures a timeout for maximum amount of time a dial will wait for a connection to complete

type TCP

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

TCP represents TCP checker

func (*TCP) Check

func (t *TCP) Check(ctx context.Context) error

Check checks TCP connection

func (*TCP) Identity

func (t *TCP) Identity() (string, error)

Identity returns the identity of the checker

Jump to

Keyboard shortcuts

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