netstatus

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

netstatus provides utility functions for querying several aspects of the network/host, especially as pertains to monitoring.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanConnect

func CanConnect(address, protocol string, timeout time.Duration) bool

CanConnect tests whether a connection can be made to a given host on its given port using protocol ("TCP"|"UDP")

func GetInterfaces

func GetInterfaces() []net.Interface

GetInterfaces returns a list of network interfaces and handles any associated error. Just for DRY.

func InterfaceIPs

func InterfaceIPs(name string) (ifaceAddresses []*net.IP)

InterfaceIPs gets all the associated IP addresses of a given interface. If the interface can't be found, it will return nil.

func PortOpen

func PortOpen(protocol string, port uint16) bool

PortOpen reports whether or not the given (decimal) port is open Its protocol argument can only be one of: "tcp" | "udp"

func Resolvable

func Resolvable(host string) bool

Resolvable checks if the given host can be resolved on the TCP and UDP nets

func ValidIP

func ValidIP(ipStr string) bool

ValidIP returns a boolean answering the question "is this a valid IPV4/6 address?

Types

This section is empty.

Jump to

Keyboard shortcuts

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