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

pc

package module
v0.0.0-...-bb87186 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: MIT Imports: 5 Imported by: 2

README

portcheck

Re-usable functions to check the availability of a port. Almost pointless, I just don't want to write them over-and-over.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CR

func CR(port int) (bool, error)

CR is a shortened alias for CheckRemote, which returns true if a port on a remote server is open and false if appears to be closed or unavailable.

func CheckLocal

func CheckLocal(port int, hosts ...string) (bool, error)

CheckLocal determines if a port is *in use*. If a port is in use locally, it will return "true" if the port is used, and will return "false" if the port is unavailable. If it encounters an error, it will return true and the error. If it you pass it a list of hosts, it will return true if *any* of them is in use.

func CheckRemote

func CheckRemote(host string, port int) (bool, error)

CheckRemote tries to connect to a remote port, and returns false if it fails. If it fails because of a timeout it returns no error, but if it fails because of any other reason it returns false and the error.

func FL

func FL(port int) int

func FindLocal

func FindLocal(port int) int

func SCL

func SCL(port int) bool

SCL is a shortened alias for ShortCheckLocal

func SCR

func SCR(host string, port int) bool

SCR is a shortened alias for ShortCheckRemote

func SFL

func SFL(port int) string

func ShortCheckLocal

func ShortCheckLocal(port int) bool

ShortCheckLocal is CheckLocal but ignoring errors

func ShortCheckRemote

func ShortCheckRemote(host string, port int) bool

ShortCheckRemote is CheckRemote but ignoring errors

func StringFindLocal

func StringFindLocal(port int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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