ping

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package ping contains string functions for the ipv4 and ipv6 packages. © Ben Garrett https://github.com/bengarrett/myip

Index

Constants

View Source
const (
	Zero  = "(0/4) " // Zero returns a pre-ping string.
	Zero1 = "(0/1) " // Zero1 returns a pre-ping string for the first flag.
)

Variables

View Source
var ErrInvalid = errors.New("invalid ip address")

Functions

func City

func City(ip string) (string, error)

City prints the IP address with its geographic location with both a country and city.

func Contains

func Contains(a []string, x string) bool

Contains returns true if x is found in the string array.

func Sprint

func Sprint(ip string) string

Sprint returns a formatted IP address for the One request.

func Sprints

func Sprints(ip string, completed int, raw bool) string

Sprint returns a formatted IP address for the All requests. The completed value is displayed as the number of finished requests. Enabling raw returns the IP address without any city or country information.

Types

This section is empty.

Jump to

Keyboard shortcuts

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