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

tcpPortWait

package module
v0.0.0-...-318275a Latest Latest
Warning

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

Go to latest
Published: May 16, 2018 License: MIT Imports: 2 Imported by: 0

README

tcp-port-wait

Wait container is accepting TCP connections.

Example

echo "Waiting ip:port connecting"

# FIXME: timeout is not included
sh tcp-port-wait.sh 127.0.0.1 5432

echo "Done tcp-port-wait"

Using tcpPortWait

Example

var p Port
p.Timeout = time.Duration(10) * time.Second
timeout, err := p.Check("127.0.0.1:5432")
if err != nil {
	fmt.Printf(err)
}
if timeout {
	fmt.Printf("timeout")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Port

type Port struct {
	Timeout time.Duration
}

Port contains tcpPortWait config parameters

func (*Port) Check

func (p *Port) Check(host string) (ret bool, err error)

Check if tcp port is open

Jump to

Keyboard shortcuts

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