Documentation
¶
Overview ¶
client implements the pingmesh request generator
Index ¶
- Constants
- Variables
- func FetchURL(rawurl, rmtIP string) *pt.PingTimes
- func GetIPs(hostname string) []net.IP
- func HostNoPort(addr string) string
- func IsPingmeshPeer(path string) bool
- func LocationFromEnv() string
- func MakePeerAddr(scheme, host, rmtIP string) (newhost, peerAddr string)
- func ParseURL(uri string) *url.URL
Constants ¶
View Source
const ( // HTML markers delimit peer location in response body ServedFromPrefix = "<p>Served from " ServedFromSuffix = "\n" // JSON markers for /peers API response body SrvLocPrefix = `"SrvLoc": "` SrvLocSuffix = `"` HttpUnknown = 502 LocUnknown = "unknown" )
Variables ¶
View Source
var (
PingPeerPaths = []string{
"/v1/peers",
"/v1/ping",
"/v1/addpeer",
}
)
Functions ¶
func FetchURL ¶ added in v0.2.5
FetchURL makes an HTTP request to the given URL, reads and discards the response body, and returns a PingTimes object with detailed timing information from the fetch. NOTE: the location handling is different from perftest! The caller does not pass in a location, instead location is parsed from the response body and returned in pt.Location.
func HostNoPort ¶ added in v0.2.5
func IsPingmeshPeer ¶ added in v0.3.1
func LocationFromEnv ¶ added in v0.2.5
func LocationFromEnv() string
LocationFromEnv returns the current location from environment variables: REP_LOCATION, if defined; otherwise REP_CITY "," REP_COUNTRY, if defined; otherwise "" (empty string)
func MakePeerAddr ¶ added in v0.3.1
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.