lib

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DATETIMEFORMAT string = "Mon, 02 Jan 2006 15:04:05 MST"
	DATETIMEFORMAT string = time.UnixDate
	NetworkType    string = "ip4" // other networks are ip which includes both v4 and v6, and ip6 which is only v6
	Protocol       string = "tcp"
)

Variables

View Source
var ListenAddr = "0.0.0.0"

Functions

func GetMinAvgMax

func GetMinAvgMax(stats []time.Duration) (time.Duration, time.Duration, time.Duration)

func IsPortUp

func IsPortUp(host string, port int, timeout int) (bool, error)

func LogStats

func LogStats(modulename string, stats []time.Duration, iterations int) string

func LogWithTimestamp

func LogWithTimestamp(log string, iserror bool) string

func Ping

func Ping(dst *net.IPAddr, payload_size int, options ...map[string]int) (*net.IPAddr, time.Duration, error)

func ResolveName

func ResolveName(ctx context.Context, name string) ([]string, error)

func ResolveNameToIPs

func ResolveNameToIPs(ctx context.Context, name string) ([]net.IP, error)

func SortTimeDurationSlice

func SortTimeDurationSlice(stats *[]time.Duration)

Types

This section is empty.

Jump to

Keyboard shortcuts

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