portsleep

package module
v0.0.0-...-6f2a797 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: MIT Imports: 4 Imported by: 1

README

portsleep

GoDoc Go Report Card

Variables

DEFAULT_TIMEOUT is the default number of times to loop before deciding that the port is not available. By default, it is set to 300 seconds.

var DEFAULT_TIMEOUT = 300

LOOP_TIMEOUT Set to true to loop forever instead of timing out

var LOOP_FOREVER = false

Functions

func HostPortSleep

func HostPortSleep(host string, port int) bool

HostPortSleep until host:port is available, or timeout after DEFAULT_TIMEOUT seconds. return true if the port is available, false if the timeout is reached

func PortSleep

func PortSleep(port int) bool

PortSleep until port is available, or timeout after DEFAULT_TIMEOUT seconds. return true if the port is available, false if the timeout is reached

func SleepAddrLoop

func SleepAddrLoop(addr string)

SleepAddrLoop until addr is available, or timeout after DEFAULT_TIMEOUT seconds panic when the timeout is reached.

func SleepHostLoop

func SleepHostLoop(host string, port int)

SleepHostLoop until host:port is available, or timeout after DEFAULT_TIMEOUT seconds panic when the timeout is reached.

func SleepLoop

func SleepLoop(port int)

SleepLoop until localhost:port is available, or timeout after DEFAULT_TIMEOUT seconds panic when the timeout is reached.

func SleepUntilAvailable

func SleepUntilAvailable(scheme, host string, port int, timeout int) bool

SleepUntilAvailable sleeps until scheme@host:port is available, or timeout after timeout seconds. return true if the port is available, false if the timeout is reached


Readme created from Go doc with goreadme

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT_TIMEOUT = 300

DEFAULT_TIMEOUT is the default number of times to loop before deciding that the port is not available. By default, it is set to 300 seconds.

View Source
var LOOP_FOREVER = false

LOOP_TIMEOUT Set to true to loop forever instead of timing out

Functions

func HostPortSleep

func HostPortSleep(host string, port int) bool

HostPortSleep until host:port is available, or timeout after DEFAULT_TIMEOUT seconds. return true if the port is available, false if the timeout is reached

func PortSleep

func PortSleep(port int) bool

PortSleep until port is available, or timeout after DEFAULT_TIMEOUT seconds. return true if the port is available, false if the timeout is reached

func SleepAddrLoop

func SleepAddrLoop(addr string)

SleepAddrLoop until addr is available, or timeout after DEFAULT_TIMEOUT seconds panic when the timeout is reached.

func SleepHostLoop

func SleepHostLoop(host string, port int)

SleepHostLoop until host:port is available, or timeout after DEFAULT_TIMEOUT seconds panic when the timeout is reached.

func SleepLoop

func SleepLoop(port int)

SleepLoop until localhost:port is available, or timeout after DEFAULT_TIMEOUT seconds panic when the timeout is reached.

func SleepUntilAvailable

func SleepUntilAvailable(scheme, host string, port int, timeout int) bool

SleepUntilAvailable sleeps until scheme@host:port is available, or timeout after timeout seconds. return true if the port is available, false if the timeout is reached

Types

This section is empty.

Jump to

Keyboard shortcuts

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