hostlabel

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 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 hostlabel makes the first label of a space's web hostnames, <user>--<name>--<port>, fit the 63 characters DNS allows a label: a longer label is never resolved, so the space could not be reached.

A label that fits is the names as they are, lowercased. One that does not keeps as much of the space's, alt name's or pool's name as fits, then a hyphen and a hash of the whole name, which the proxy matches the name by.

Index

Constants

View Source
const MaxLen = 63

MaxLen is the most characters DNS allows in one label.

Variables

This section is empty.

Functions

func CheckTunnel

func CheckTunnel(user, name string) error

CheckTunnel refuses a web tunnel whose host label, <user>--<name>, would be longer than DNS allows, so no one could reach it.

func Hash

func Hash(name string) string

Hash is the hash that ends name shortened: FNV-1a, 32 bits, of the name lowercased, in hex. The web interface and the MCP tools work it out the same way.

func Label

func Label(user, name, port string) string

Label is the label of the host for a user's space, alt name or pool and a port, a number or "vnc".

func Matches

func Matches(part, name string) bool

Matches says whether part, the name in a host's label, is name shortened.

func Shortened

func Shortened(part string) bool

Shortened says whether part, the name in a host's label, has the shape of a shortened name: a prefix, a hyphen and a hash.

Types

This section is empty.

Jump to

Keyboard shortcuts

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