netutils

package
v0.0.0-...-a295026 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package netutils contains utilities to work with ports and URLs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindUnusedTCPPort

func FindUnusedTCPPort() int

FindUnusedTCPPort finds an unused TCP port by opening a TCP port on an unused port chosen by the operating system, recovering the port number and immediately closing the socket.

This function does not guarantee that multiple calls will return different port numbers, so it might cause tests to flake out. However, the odds of this happening are low. In the future, we might decide to keep track of previously returned port numbers, and keep probing the OS until it returns a previously unseen port number.

func RootDomain

func RootDomain(url string) string

RootDomain returns the root domain, i.e. "perf.skia.org" => "skia.org".

Types

This section is empty.

Jump to

Keyboard shortcuts

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