hostport

package
v1.33.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package hostport completes an address an action connects to with the port it is taken at when it names none, so that the guard of a run checks the same host and port the action dials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OfURL

func OfURL(u *url.URL) string

OfURL returns the host and port of u, taken at the port of its scheme when it names none: 443 for https, and 80 for any other. Only http and https are known, so a URL of another scheme that connects over TLS, such as wss or grpcs, is taken at 80, and a caller of one must name its port itself.

func WithPort

func WithPort(hostport, port string) string

WithPort returns hostport with port when it names none. An IPv6 address may be given bare or in brackets.

Types

This section is empty.

Jump to

Keyboard shortcuts

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