shannon

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ErrDomain = "error"

ErrDomain is a fallback domain value used when domain extraction fails

Variables

This section is empty.

Functions

func ExtractDomainOrHost

func ExtractDomainOrHost(rawURL string) (string, error)

ExtractDomainOrHost extracts the effective TLD+1 from a URL. It falls back to a reasonable domain extraction for localhost, IP addresses, and other non-standard hosts. Note: Callers should log the error with full context (supplier, service_id, etc.)

func ExtractTLDFromEndpointAddr

func ExtractTLDFromEndpointAddr(addr string) string

ExtractTLDFromEndpointAddr extracts effective TLD+1 from endpoint address. Returns an empty string if the TLD cannot be determined.

func GetEndpointTLDs

func GetEndpointTLDs(endpoints protocol.EndpointAddrList) map[protocol.EndpointAddr]string

GetEndpointTLDs extracts TLD information from endpoint addresses

func LogEndpointTLDDiversity

func LogEndpointTLDDiversity(logger polylog.Logger, endpoints protocol.EndpointAddrList)

Types

This section is empty.

Jump to

Keyboard shortcuts

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