Documentation
¶
Overview ¶
Package target defines canonical WireGuard target identities and resolves their server-side addresses.
Index ¶
Constants ¶
View Source
const ( // MaxHostnameSize is the longest supported DNS hostname without its terminating root label. MaxHostnameSize = 253 // MaxTextSize is the longest canonical HOST:PORT representation. MaxTextSize = MaxHostnameSize + 1 + 5 // MaxCandidates bounds handshake fan-out and retained DNS results for one target. MaxCandidates = 16 )
Variables ¶
View Source
var ( // ErrInvalid indicates a malformed or unsafe WireGuard target. ErrInvalid = errors.New("invalid UDP target") // ErrNoAddresses indicates that a target resolved to no usable unicast addresses. ErrNoAddresses = errors.New("target has no usable addresses") )
Functions ¶
func Resolve ¶
Resolve returns the bounded, deduplicated addresses currently represented by endpoint.
func ValidAddress ¶
ValidAddress reports whether address can identify a unicast WireGuard target without an IPv6 zone.
Types ¶
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint is one canonical IP-literal or DNS WireGuard target with a numeric UDP port.
func FromAddrPort ¶
FromAddrPort returns a canonical target for address.
func Parse ¶
Parse parses and canonicalizes an IP-literal or DNS target with an explicit, nonzero port.
Click to show internal directories.
Click to hide internal directories.