probe

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Prober

type Prober interface {
	Probe(host string, port int, timeout time.Duration) (Result, error)
}

Prober is an interface that defines the Probe function for doing TCP readiness/liveness checks.

func New

func New() Prober

New creates Prober.

type Result

type Result string

Result is a string used to handle the results for probing container readiness/liveness

const (
	// Success Result
	Success Result = "success"
	// Warning Result. Logically success, but with additional debugging information attached.
	Warning Result = "warning"
	// Failure Result
	Failure Result = "failure"
	// Unknown Result
	Unknown Result = "unknown"
)

func DoTCPProbe

func DoTCPProbe(addr string, timeout time.Duration) (Result, error)

DoTCPProbe checks that a TCP socket to the address can be opened. If the socket can be opened, it returns Success If the socket fails to open, it returns Failure. This is exported because some other packages may want to do direct TCP probes.

Jump to

Keyboard shortcuts

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