peername

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 4 Imported by: ? 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 peername validates peer identities. A peer id has to work as a DNS label, because the hub's proxy can route to a peer by hostname (<peer>.<proxy-domain>): a name that cannot be a label is a peer that some deployments simply cannot reach. Enforcing it at mint time (and at attach) keeps every name routable by every strategy, whatever the hub is configured with today.

Index

Constants

View Source
const MaxLen = 63

MaxLen is the DNS label limit (RFC 1123).

View Source
const Rules = "lowercase letters, digits and dashes, starting and ending with a letter or digit, at most 63 characters"

Rules is the human-readable constraint, reused in errors and help text so the CLI, the API, and the console all say the same thing.

Variables

This section is empty.

Functions

func Random

func Random() (string, error)

Random returns a name like "cosy-eddy-aec23e". It is always a valid peer name, and unique in practice without consulting the hub.

func Validate

func Validate(name string) error

Validate reports whether name is usable as a peer id, which means usable as a DNS label: 1..63 characters of [a-z0-9-], starting and ending alphanumeric. Uppercase is rejected rather than folded, because hostnames are case-insensitive while peer ids are not: a peer enrolled as "Alice" could never be reached at alice.<domain>.

Types

This section is empty.

Jump to

Keyboard shortcuts

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