templates

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AboutPage

func AboutPage(freshness DataFreshness, privacy PrivacySync) templ.Component

AboutPage renders the about page with project information, data freshness, and the Privacy & Sync section.

func Breadcrumb(typePlural string, entityName string) templ.Component

Breadcrumb renders navigation breadcrumbs: Home > TypePlural > EntityName. typePlural is the display name for the entity type (e.g., "Networks"). entityName is the specific entity being viewed.

func CampusDetailPage

func CampusDetailPage(data CampusDetail) templ.Component

CampusDetailPage renders the full campus detail page with header, stats, detail fields, and a collapsible lazy-loaded section for facilities.

func CampusFacilitiesList

func CampusFacilitiesList(rows []CampusFacilityRow, moreURL string) templ.Component

CampusFacilitiesList renders the list of campus facilities as a 3-column sortable table (Name, City, Country+flag) linking to the respective facility detail page.

func CampusFacilitiesRows added in v1.23.0

func CampusFacilitiesRows(rows []CampusFacilityRow, moreURL string) templ.Component

CampusFacilitiesRows renders one page of rows for CampusFacilitiesList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func CarrierDetailPage

func CarrierDetailPage(data CarrierDetail) templ.Component

CarrierDetailPage renders the full carrier detail page with header, stats, detail fields, and a collapsible lazy-loaded section for facilities.

func CarrierFacilitiesList

func CarrierFacilitiesList(rows []CarrierFacilityRow, moreURL string) templ.Component

CarrierFacilitiesList renders the list of carrier facilities as a single-column name-only table linking to the respective facility detail page.

func CarrierFacilitiesRows added in v1.23.0

func CarrierFacilitiesRows(rows []CarrierFacilityRow, moreURL string) templ.Component

CarrierFacilitiesRows renders one page of rows for CarrierFacilitiesList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func CollapsibleSection

func CollapsibleSection(title string, count int, bandwidth string, loadURL string) templ.Component

CollapsibleSection renders a collapsible details/summary element with htmx lazy loading on first expand. If count is 0, the section is not expandable and shows a static "None" message. A non-empty bandwidth (aggregate port speed) is appended to the count in the header.

func CompareFormPage

func CompareFormPage(asn1 string, asn2 string) templ.Component

CompareFormPage renders the comparison form with optional pre-filled ASN values. asn1 and asn2 are pre-filled when navigating from a network detail page.

func CompareResultsPage

func CompareResultsPage(data CompareData) templ.Component

CompareResultsPage renders the full comparison results between two networks.

func CopyableIP added in v1.7.0

func CopyableIP(label string, addr string) templ.Component

CopyableIP renders an IP address with click-to-copy and a hover clipboard icon. The click handling is a delegated listener in /static/ui.js: elements carrying data-copy are copied to the clipboard, and the .copied-msg inside the enclosing [data-copy-group] flashes as confirmation.

func CountryFlag added in v1.11.0

func CountryFlag(code string) templ.Component

CountryFlag renders a country flag icon with the country code text. Uses flag-icons CSS classes. If code is empty, renders nothing.

func DetailField

func DetailField(label string, value string) templ.Component

DetailField renders a label:value pair. Only renders if value is non-empty.

func DetailHeader

func DetailHeader(typeBadge string, accentColor string, name string, subtitle string) templ.Component

DetailHeader renders the page header with type badge, entity name, and subtitle. The accentColor should match the search palette: emerald=net, sky=ix, violet=fac, amber=org, rose=campus, cyan=carrier.

func DetailLink(label string, url string) templ.Component

DetailLink renders a clickable URL field. Only renders if url is non-empty.

url is upstream-controlled free text (a PeeringDB website / looking-glass / route-server / policy URL), so it MUST go through templ.URL — which strips dangerous schemes like javascript: and data: — and NOT templ.SafeURL, which is an explicit "trust me" bypass of that sanitization and would let a malformed upstream record render an executable href.

func FacCarriersList

func FacCarriersList(rows []FacCarrierRow, moreURL string) templ.Component

FacCarriersList renders facility carriers as a single-column name-only table. Pre-sorted alphabetically server-side, no sort UI.

func FacCarriersRows added in v1.23.0

func FacCarriersRows(rows []FacCarrierRow, moreURL string) templ.Component

FacCarriersRows renders one page of rows for FacCarriersList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func FacIXPsList

func FacIXPsList(rows []FacIXRow, moreURL string) templ.Component

FacIXPsList renders facility IXPs as a single-column name-only table. Pre-sorted alphabetically server-side, no sort UI.

func FacIXPsRows added in v1.23.0

func FacIXPsRows(rows []FacIXRow, moreURL string) templ.Component

FacIXPsRows renders one page of rows for FacIXPsList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func FacNetworksList

func FacNetworksList(rows []FacNetworkRow, moreURL string) templ.Component

FacNetworksList renders facility networks as a 3-column sortable table with Name, ASN, and Country+flag columns.

func FacNetworksRows added in v1.23.0

func FacNetworksRows(rows []FacNetworkRow, moreURL string) templ.Component

FacNetworksRows renders one page of rows for FacNetworksList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func FacilityDetailPage

func FacilityDetailPage(data FacilityDetail) templ.Component

FacilityDetailPage renders the full facility detail page with header, stats, detail fields, and collapsible lazy-loaded sections for related records.

func Footer() templ.Component

func FormatThousands added in v1.20.1

func FormatThousands(n int) string

FormatThousands renders n with comma thousands separators (e.g. 1234 -> "1,234").

func Home

func Home(query string, groups []SearchGroup) templ.Component

Home renders the homepage with search form and API quick links. query is pre-filled on direct navigation (bookmarked URLs). groups contains pre-computed search results for bookmarked URL support.

func IXDetailPage

func IXDetailPage(data IXDetail) templ.Component

IXDetailPage renders the full IXP detail page with header, stats, detail fields, and collapsible lazy-loaded sections for related records.

func IXFacilitiesList

func IXFacilitiesList(rows []IXFacilityRow, moreURL string) templ.Component

IXFacilitiesList renders IX facilities as a 3-column sortable table with Name, City, and Country+flag columns.

func IXFacilitiesRows added in v1.23.0

func IXFacilitiesRows(rows []IXFacilityRow, moreURL string) templ.Component

IXFacilitiesRows renders one page of rows for IXFacilitiesList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func IXParticipantsList

func IXParticipantsList(rows []IXParticipantRow, moreURL string) templ.Component

IXParticipantsList renders IX participants as a 6-column sortable table with Name, ASN, Speed, IPv4, IPv6, and RS columns.

func IXParticipantsRows added in v1.23.0

func IXParticipantsRows(rows []IXParticipantRow, moreURL string) templ.Component

IXParticipantsRows renders one page of rows for IXParticipantsList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func IXPrefixesList

func IXPrefixesList(rows []IXPrefixRow, moreURL string) templ.Component

IXPrefixesList renders IX prefixes as a 3-column sortable table with Prefix, Protocol, and DFZ columns.

func IXPrefixesRows added in v1.23.0

func IXPrefixesRows(rows []IXPrefixRow, moreURL string) templ.Component

IXPrefixesRows renders one page of rows for IXPrefixesList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func Layout

func Layout(opts LayoutOptions, contents templ.Component) templ.Component

func MapContainer added in v1.11.0

func MapContainer(id string, markers []MapMarker, zoom int) templ.Component

MapContainer renders a map container div carrying data attributes that /static/map-init.js reads to initialize a single-marker Leaflet map (CARTO tiles, theme-aware via window.__pdbMaps). Exactly one marker is expected. A future extension will handle multiple markers with fitBounds.

func MultiPinMapContainer added in v1.11.0

func MultiPinMapContainer(id string, markers []MapMarker, ariaLabel string, showLegend bool, legendLabels map[string]string) templ.Component

MultiPinMapContainer renders a taller map container whose data attributes /static/map-init.js reads to build a clustered circleMarker Leaflet map (fitBounds auto-zoom, optional legend). If no markers have valid coordinates, nothing is rendered. When some markers lack coordinates, an unmapped count message is shown below the map.

func Nav() templ.Component

func NetworkContactsList

func NetworkContactsList(rows []ContactRow, moreURL string) templ.Component

NetworkContactsList renders network contacts as a 4-column sortable table with Name, Role, Email, and Phone columns.

func NetworkContactsRows added in v1.23.0

func NetworkContactsRows(rows []ContactRow, moreURL string) templ.Component

NetworkContactsRows renders one page of rows for NetworkContactsList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func NetworkDetailPage

func NetworkDetailPage(data NetworkDetail) templ.Component

NetworkDetailPage renders the full network detail page with header, stats, detail fields, and collapsible lazy-loaded sections for related records.

func NetworkFacilitiesList

func NetworkFacilitiesList(rows []NetworkFacRow, moreURL string) templ.Component

NetworkFacilitiesList renders network facility presences as a 3-column sortable table with Name, City, and Country+flag columns.

func NetworkFacilitiesRows added in v1.23.0

func NetworkFacilitiesRows(rows []NetworkFacRow, moreURL string) templ.Component

NetworkFacilitiesRows renders one page of rows for NetworkFacilitiesList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func NetworkIXLansList

func NetworkIXLansList(rows []NetworkIXLanRow, moreURL string) templ.Component

NetworkIXLansList renders network IX presences as a 5-column sortable table with IX Name, Speed, IPv4, IPv6, and RS columns.

func NetworkIXLansRows added in v1.23.0

func NetworkIXLansRows(rows []NetworkIXLanRow, moreURL string) templ.Component

NetworkIXLansRows renders one page of rows for NetworkIXLansList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func NotFoundPage

func NotFoundPage() templ.Component

NotFoundPage renders a styled 404 page with an embedded search box.

func OrgCampusesList

func OrgCampusesList(rows []OrgCampusRow, moreURL string) templ.Component

OrgCampusesList renders the list of org campuses as a single-column name-only table linking to the respective campus detail page.

func OrgCampusesRows added in v1.23.0

func OrgCampusesRows(rows []OrgCampusRow, moreURL string) templ.Component

OrgCampusesRows renders one page of rows for OrgCampusesList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func OrgCarriersList

func OrgCarriersList(rows []OrgCarrierRow, moreURL string) templ.Component

OrgCarriersList renders the list of org carriers as a single-column name-only table linking to the respective carrier detail page.

func OrgCarriersRows added in v1.23.0

func OrgCarriersRows(rows []OrgCarrierRow, moreURL string) templ.Component

OrgCarriersRows renders one page of rows for OrgCarriersList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func OrgDetailPage

func OrgDetailPage(data OrgDetail) templ.Component

OrgDetailPage renders the full organization detail page with header, stats, detail fields, and collapsible lazy-loaded sections for related records.

func OrgFacilitiesList

func OrgFacilitiesList(rows []OrgFacilityRow, moreURL string) templ.Component

OrgFacilitiesList renders the list of org facilities as a 3-column sortable table (Name, City, Country+flag) linking to the respective facility detail page.

func OrgFacilitiesRows added in v1.23.0

func OrgFacilitiesRows(rows []OrgFacilityRow, moreURL string) templ.Component

OrgFacilitiesRows renders one page of rows for OrgFacilitiesList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func OrgIXPsList

func OrgIXPsList(rows []OrgIXRow, moreURL string) templ.Component

OrgIXPsList renders the list of org IXPs as a single-column name-only table linking to the respective IX detail page.

func OrgIXPsRows added in v1.23.0

func OrgIXPsRows(rows []OrgIXRow, moreURL string) templ.Component

OrgIXPsRows renders one page of rows for OrgIXPsList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func OrgNetworksList

func OrgNetworksList(rows []OrgNetworkRow, moreURL string) templ.Component

OrgNetworksList renders the list of org networks as a 2-column sortable table (Name, ASN) linking to the respective network detail page by ASN.

func OrgNetworksRows added in v1.23.0

func OrgNetworksRows(rows []OrgNetworkRow, moreURL string) templ.Component

OrgNetworksRows renders one page of rows for OrgNetworksList, followed by a "Load more" row while another page remains. It is also the htmx response shape for the load-more request, so fetched pages accumulate in the same tbody.

func SearchForm

func SearchForm(query string, groups []SearchGroup) templ.Component

SearchForm renders the search input with htmx attributes and results container. query is pre-filled on direct navigation; groups are pre-rendered for bookmarked URLs.

func SearchResults

func SearchResults(groups []SearchGroup, query string) templ.Component

SearchResults renders grouped search results with per-type colored badges, count badges, and compact single-line result rows with inline metadata. query is echoed into the per-type "View all" link. Returns empty output when groups is nil or empty.

func SearchRow added in v1.20.0

func SearchRow(result SearchResult) templ.Component

SearchRow renders a single compact search hit row: name on the left, inline country/city/ASN metadata on the right. Shared by the grouped quick-search and the per-type "view all" page so the two never drift.

func SearchTypeMore added in v1.20.0

func SearchTypeMore(data SearchTypeView) templ.Component

SearchTypeMore is the htmx response to a "Load more" click: the next page of rows followed by a fresh "Load more" button (or nothing when exhausted). It replaces the previous button via hx-swap="outerHTML", so rows accumulate in the same divided container.

func SearchTypePage added in v1.20.0

func SearchTypePage(data SearchTypeView) templ.Component

SearchTypePage renders the per-type "view all" results page: a header with the exact match count, the first page of rows, and an htmx "Load more" button that appends subsequent pages.

func ServerErrorPage

func ServerErrorPage() templ.Component

ServerErrorPage renders a styled 500 page with a link back to the homepage.

func StatBadge

func StatBadge(label string, count int) templ.Component

StatBadge renders a small stat indicator for the header area.

func SyncingPage

func SyncingPage() templ.Component

SyncingPage renders a standalone page shown by readiness middleware before the first sync completes. It is self-contained with its own DOCTYPE, head, and styling because it renders outside the normal handler flow at the middleware level.

Types

type AboutPageData added in v1.14.0

type AboutPageData struct {
	Freshness DataFreshness
	Privacy   PrivacySync
}

AboutPageData bundles the two payloads consumed by the terminal About renderer. The dispatch table (internal/web/termrender/dispatch.go) registers a single concrete type per page; this struct is that type for /ui/about.

type CampusDetail

type CampusDetail struct {
	// ID is the campus's PeeringDB identifier.
	ID int
	// Name is the campus's display name.
	Name string
	// NameLong is the campus's long-form name.
	NameLong string
	// AKA is the "also known as" alias.
	AKA string
	// Website is the campus's website URL.
	Website string
	// OrgName is the name of the parent organization.
	OrgName string
	// OrgID is the parent organization's PeeringDB ID.
	OrgID int
	// City is the campus's city.
	City string
	// State is the campus's state or province.
	State string
	// Country is the campus's country code.
	Country string
	// Zipcode is the postal code.
	Zipcode string
	// Notes contains freeform notes.
	Notes string
	// Status is the record status.
	Status string
	// FacCount is the count of facilities (requires query).
	FacCount int
	// Facilities holds eager-loaded facility rows for terminal/JSON rendering. Nil for web UI requests.
	Facilities []CampusFacilityRow `json:"facilities,omitempty"`
}

CampusDetail holds display data for a campus detail page.

type CampusFacilityRow

type CampusFacilityRow struct {
	// FacName is the facility name.
	FacName string
	// FacID is the facility's PeeringDB ID for cross-linking.
	FacID int
	// City is the facility's city.
	City string
	// Country is the facility's country code.
	Country string
	// Latitude is the facility's geographic latitude. Zero means no data.
	Latitude float64
	// Longitude is the facility's geographic longitude. Zero means no data.
	Longitude float64
}

CampusFacilityRow holds display data for a campus's facility row.

type CarrierDetail

type CarrierDetail struct {
	// ID is the carrier's PeeringDB identifier.
	ID int
	// Name is the carrier's display name.
	Name string
	// NameLong is the carrier's long-form name.
	NameLong string
	// AKA is the "also known as" alias.
	AKA string
	// Website is the carrier's website URL.
	Website string
	// OrgName is the name of the parent organization.
	OrgName string
	// OrgID is the parent organization's PeeringDB ID.
	OrgID int
	// Notes contains freeform notes.
	Notes string
	// Status is the record status.
	Status string
	// FacCount is the pre-computed count of facilities.
	FacCount int
	// Facilities holds eager-loaded facility rows for terminal/JSON rendering. Nil for web UI requests.
	Facilities []CarrierFacilityRow `json:"facilities,omitempty"`
}

CarrierDetail holds display data for a carrier detail page.

type CarrierFacilityRow

type CarrierFacilityRow struct {
	// FacName is the facility name.
	FacName string
	// FacID is the facility's PeeringDB ID for cross-linking.
	FacID int
	// Latitude is the facility's geographic latitude. Zero means no data.
	Latitude float64
	// Longitude is the facility's geographic longitude. Zero means no data.
	Longitude float64
}

CarrierFacilityRow holds display data for a carrier's facility row.

type CompareCampus

type CompareCampus struct {
	// CampusID is the campus's PeeringDB ID for cross-linking.
	CampusID int
	// CampusName is the campus display name.
	CampusName string
	// SharedFacilities lists facilities within this campus where both networks are present.
	SharedFacilities []CompareCampusFacility
}

CompareCampus holds comparison data for a shared campus.

type CompareCampusFacility

type CompareCampusFacility struct {
	// FacID is the facility's PeeringDB ID for cross-linking.
	FacID int
	// FacName is the facility display name.
	FacName string
}

CompareCampusFacility holds a facility within a shared campus.

type CompareData

type CompareData struct {
	// NetA is the first network's summary info.
	NetA CompareNetwork
	// NetB is the second network's summary info.
	NetB CompareNetwork
	// SharedIXPs lists IXPs where both networks are present.
	SharedIXPs []CompareIXP
	// SharedFacilities lists facilities where both networks are present.
	SharedFacilities []CompareFacility
	// SharedCampuses lists campuses where both networks have facility presence.
	SharedCampuses []CompareCampus
	// AllIXPs lists all IXPs for both networks with a shared flag (for full view).
	AllIXPs []CompareIXP
	// AllFacilities lists all facilities for both networks with shared flag (for full view).
	AllFacilities []CompareFacility
	// ViewMode is "shared" (default) or "full".
	ViewMode string
}

CompareData holds the full comparison result for template rendering.

type CompareFacPresence

type CompareFacPresence struct {
	// LocalASN is the local ASN used at this facility.
	LocalASN int
}

CompareFacPresence holds one network's presence details at a facility.

type CompareFacility

type CompareFacility struct {
	// FacID is the facility's PeeringDB ID for cross-linking.
	FacID int
	// FacName is the facility display name.
	FacName string
	// City is the facility's city.
	City string
	// Country is the facility's country code.
	Country string
	// Latitude is the facility's geographic latitude. Zero means no data.
	Latitude float64
	// Longitude is the facility's geographic longitude. Zero means no data.
	Longitude float64
	// Shared indicates both networks are present at this facility.
	Shared bool
	// NetA holds network A's presence info (nil if not present).
	NetA *CompareFacPresence
	// NetB holds network B's presence info (nil if not present).
	NetB *CompareFacPresence
}

CompareFacility holds comparison data for a single facility.

type CompareIXP

type CompareIXP struct {
	// IXID is the exchange's PeeringDB ID for cross-linking.
	IXID int
	// IXName is the exchange display name.
	IXName string
	// Shared indicates both networks are present at this IXP.
	Shared bool
	// NetA holds network A's presence details (nil if not present).
	NetA *CompareIXPresence
	// NetB holds network B's presence details (nil if not present).
	NetB *CompareIXPresence
}

CompareIXP holds comparison data for a single IXP showing both networks' presence info.

type CompareIXPresence

type CompareIXPresence struct {
	// Speed is the port speed in Mbps.
	Speed int
	// IPAddr4 is the IPv4 peering address.
	IPAddr4 string
	// IPAddr6 is the IPv6 peering address.
	IPAddr6 string
	// IsRSPeer indicates route server peering.
	IsRSPeer bool
	// Operational indicates whether the connection is operational.
	Operational bool
}

CompareIXPresence holds one network's presence details at an IXP.

type CompareNetwork

type CompareNetwork struct {
	// ASN is the Autonomous System Number.
	ASN int
	// Name is the network's display name.
	Name string
	// ID is the network's PeeringDB internal identifier.
	ID int
}

CompareNetwork holds summary info for one side of the comparison.

type ContactRow

type ContactRow struct {
	// Name is the contact's name.
	Name string
	// Role is the contact's role (e.g. "NOC", "Policy").
	Role string
	// Email is the contact's email address.
	Email string
	// Phone is the contact's phone number.
	Phone string
	// URL is the contact's URL.
	URL string
}

ContactRow holds display data for a network contact (poc) row.

type DataFreshness

type DataFreshness struct {
	Available  bool
	LastSyncAt time.Time
	Age        time.Duration
}

DataFreshness holds sync status information for the About page display.

type FacCarrierRow

type FacCarrierRow struct {
	// CarrierName is the carrier name.
	CarrierName string
	// CarrierID is the carrier's PeeringDB ID for cross-linking.
	CarrierID int
}

FacCarrierRow holds display data for a facility's carrier row.

type FacIXRow

type FacIXRow struct {
	// IXName is the exchange name.
	IXName string
	// IXID is the exchange's PeeringDB ID for cross-linking.
	IXID int
}

FacIXRow holds display data for a facility's IXP row.

type FacNetworkRow

type FacNetworkRow struct {
	// NetName is the network's name.
	NetName string
	// ASN is the network's Autonomous System Number.
	ASN int
	// City is the facility network's city (from NetworkFacility computed field).
	City string
	// Country is the facility network's country code (from NetworkFacility computed field).
	Country string
}

FacNetworkRow holds display data for a facility's network row.

type FacilityDetail

type FacilityDetail struct {
	// ID is the facility's PeeringDB identifier.
	ID int
	// Name is the facility's display name.
	Name string
	// NameLong is the facility's long-form name.
	NameLong string
	// AKA is the "also known as" alias.
	AKA string
	// Website is the facility's website URL.
	Website string
	// OrgName is the name of the parent organization.
	OrgName string
	// OrgID is the parent organization's PeeringDB ID.
	OrgID int
	// CampusName is the name of the parent campus, if any.
	CampusName string
	// CampusID is the parent campus's PeeringDB ID.
	CampusID int
	// Address1 is the primary street address.
	Address1 string
	// Address2 is the secondary address line.
	Address2 string
	// City is the facility's city.
	City string
	// State is the facility's state or province.
	State string
	// Country is the facility's country code.
	Country string
	// Zipcode is the postal code.
	Zipcode string
	// RegionContinent is the facility's region/continent.
	RegionContinent string
	// CLLI is the CLLI code.
	CLLI string
	// Notes contains freeform notes.
	Notes string
	// Status is the record status.
	Status string
	// NetCount is the pre-computed count of networks present.
	NetCount int
	// IXCount is the pre-computed count of IXPs present.
	IXCount int
	// CarrierCount is the pre-computed count of carriers.
	CarrierCount int
	// Latitude is the facility's geographic latitude. Zero means no data.
	Latitude float64
	// Longitude is the facility's geographic longitude. Zero means no data.
	Longitude float64
	// Networks holds eager-loaded network rows for terminal/JSON rendering. Nil for web UI requests.
	Networks []FacNetworkRow `json:"networks,omitempty"`
	// IXPs holds eager-loaded IXP rows for terminal/JSON rendering. Nil for web UI requests.
	IXPs []FacIXRow `json:"ixps,omitempty"`
	// Carriers holds eager-loaded carrier rows for terminal/JSON rendering. Nil for web UI requests.
	Carriers []FacCarrierRow `json:"carriers,omitempty"`
}

FacilityDetail holds display data for a facility detail page.

type IXDetail

type IXDetail struct {
	// ID is the IXP's PeeringDB identifier.
	ID int
	// Name is the IXP's display name.
	Name string
	// NameLong is the IXP's long-form name.
	NameLong string
	// AKA is the "also known as" alias.
	AKA string
	// Website is the IXP's website URL.
	Website string
	// OrgName is the name of the parent organization.
	OrgName string
	// OrgID is the parent organization's PeeringDB ID.
	OrgID int
	// City is the IXP's city.
	City string
	// Country is the IXP's country code.
	Country string
	// RegionContinent is the IXP's region/continent.
	RegionContinent string
	// Media is the exchange media type.
	Media string
	// ProtoUnicast indicates unicast support.
	ProtoUnicast bool
	// ProtoMulticast indicates multicast support.
	ProtoMulticast bool
	// ProtoIPv6 indicates IPv6 support.
	ProtoIPv6 bool
	// Notes contains freeform notes.
	Notes string
	// Status is the record status.
	Status string
	// NetCount is the pre-computed count of network participants.
	NetCount int
	// FacCount is the pre-computed count of facilities.
	FacCount int
	// PrefixCount is the count of peering LAN prefixes (requires IxLan traversal).
	PrefixCount int
	// AggregateBW is the total bandwidth in Mbps across all participants (for header display).
	AggregateBW int
	// Participants holds eager-loaded participant rows for terminal/JSON rendering. Nil for web UI requests.
	Participants []IXParticipantRow `json:"participants,omitempty"`
	// Facilities holds eager-loaded facility rows for terminal/JSON rendering. Nil for web UI requests.
	Facilities []IXFacilityRow `json:"facilities,omitempty"`
	// Prefixes holds eager-loaded prefix rows for terminal/JSON rendering. Nil for web UI requests.
	Prefixes []IXPrefixRow `json:"prefixes,omitempty"`
}

IXDetail holds display data for an IXP detail page.

type IXFacilityRow

type IXFacilityRow struct {
	// FacName is the facility name.
	FacName string
	// FacID is the facility's PeeringDB ID for cross-linking.
	FacID int
	// City is the facility's city.
	City string
	// Country is the facility's country code.
	Country string
	// Latitude is the facility's geographic latitude. Zero means no data.
	Latitude float64
	// Longitude is the facility's geographic longitude. Zero means no data.
	Longitude float64
}

IXFacilityRow holds display data for an IXP facility row.

type IXParticipantRow

type IXParticipantRow struct {
	// NetName is the participant network's name.
	NetName string
	// ASN is the participant's Autonomous System Number.
	ASN int
	// Speed is the port speed in Mbps.
	Speed int
	// IPAddr4 is the IPv4 peering address.
	IPAddr4 string
	// IPAddr6 is the IPv6 peering address.
	IPAddr6 string
	// IsRSPeer indicates route server peering.
	IsRSPeer bool
}

IXParticipantRow holds display data for an IXP participant row.

type IXPrefixRow

type IXPrefixRow struct {
	// Prefix is the peering LAN prefix.
	Prefix string
	// Protocol is the address family ("IPv4" or "IPv6").
	Protocol string
	// InDFZ indicates whether the prefix is in the default-free zone.
	InDFZ bool
}

IXPrefixRow holds display data for an IXP prefix row.

type LayoutOptions added in v1.23.0

type LayoutOptions struct {
	Title       string
	Description string
	Canonical   string
	NeedsMap    bool
}

LayoutOptions carries per-page head configuration for Layout. NeedsMap gates the Leaflet/markercluster includes: only the pages that render a MapContainer pay the ~200 KB of map assets. Description and Canonical are optional SEO fields: when set they emit the meta description / canonical link and their OpenGraph twins.

type MapMarker added in v1.11.0

type MapMarker struct {
	// Lat is the marker's latitude.
	Lat float64
	// Lng is the marker's longitude.
	Lng float64
	// Name is the display name in the popup.
	Name string
	// Location is the city/country text in the popup.
	Location string
	// NetCount is the network count shown in the popup.
	NetCount int
	// IXCount is the IX count shown in the popup.
	IXCount int
	// DetailURL is the link to the entity detail page.
	DetailURL string
	// Color is the circleMarker fillColor hex (e.g. "#10b981"). Empty for single-pin maps.
	Color string
	// Stroke is the circleMarker stroke hex (e.g. "#059669"). Empty for single-pin maps.
	Stroke string
	// Extra is an additional popup line (e.g. network names for compare maps). Empty if not needed.
	Extra string
}

MapMarker holds data for a single map pin.

type NetworkDetail

type NetworkDetail struct {
	// ID is the network's PeeringDB internal identifier.
	ID int
	// ASN is the Autonomous System Number.
	ASN int
	// Name is the network's display name.
	Name string
	// NameLong is the network's long-form name.
	NameLong string
	// AKA is the "also known as" alias.
	AKA string
	// Website is the network's website URL.
	Website string
	// OrgName is the name of the parent organization.
	OrgName string
	// OrgID is the parent organization's PeeringDB ID.
	OrgID int
	// IRRAsSet is the IRR AS-SET identifier.
	IRRAsSet string
	// InfoType is the network type classification.
	InfoType string
	// InfoScope is the geographic scope.
	InfoScope string
	// InfoTraffic is the traffic level.
	InfoTraffic string
	// InfoRatio is the traffic ratio.
	InfoRatio string
	// InfoUnicast indicates unicast support.
	InfoUnicast bool
	// InfoMulticast indicates multicast support.
	InfoMulticast bool
	// InfoIPv6 indicates IPv6 support.
	InfoIPv6 bool
	// InfoPrefixes4 is the IPv4 prefix count.
	InfoPrefixes4 int
	// InfoPrefixes6 is the IPv6 prefix count.
	InfoPrefixes6 int
	// LookingGlass is the looking glass URL.
	LookingGlass string
	// RouteServer is the route server URL.
	RouteServer string
	// PolicyGeneral is the general peering policy.
	PolicyGeneral string
	// PolicyURL is the peering policy URL.
	PolicyURL string
	// Notes contains freeform notes.
	Notes string
	// Status is the record status.
	Status string
	// IXCount is the pre-computed count of IX presences.
	IXCount int
	// FacCount is the pre-computed count of facility presences.
	FacCount int
	// PocCount is the count of contacts (requires query).
	PocCount int
	// AggregateBW is the total bandwidth in Mbps across all IX presences (for header display).
	AggregateBW int
	// IXPresences holds eager-loaded IX presence rows for terminal/JSON rendering.
	// Nil for web UI requests that lazy-load via htmx fragments.
	IXPresences []NetworkIXLanRow `json:"ixPresences,omitempty"`
	// FacPresences holds eager-loaded facility presence rows for terminal/JSON rendering.
	// Nil for web UI requests that lazy-load via htmx fragments.
	FacPresences []NetworkFacRow `json:"facPresences,omitempty"`
}

NetworkDetail holds display data for a network detail page.

type NetworkFacRow

type NetworkFacRow struct {
	// FacName is the facility name.
	FacName string
	// FacID is the facility's PeeringDB ID for cross-linking.
	FacID int
	// LocalASN is the local ASN at this facility.
	LocalASN int
	// City is the facility's city.
	City string
	// Country is the facility's country code.
	Country string
	// Latitude is the facility's geographic latitude. Zero means no data.
	Latitude float64
	// Longitude is the facility's geographic longitude. Zero means no data.
	Longitude float64
}

NetworkFacRow holds display data for a network's facility presence row.

type NetworkIXLanRow

type NetworkIXLanRow struct {
	// IXName is the exchange name.
	IXName string
	// IXID is the exchange's PeeringDB ID for cross-linking.
	IXID int
	// Speed is the port speed in Mbps.
	Speed int
	// IPAddr4 is the IPv4 peering address.
	IPAddr4 string
	// IPAddr6 is the IPv6 peering address.
	IPAddr6 string
	// IsRSPeer indicates route server peering.
	IsRSPeer bool
}

NetworkIXLanRow holds display data for a network's IX presence row.

type OrgCampusRow

type OrgCampusRow struct {
	// CampusName is the campus name.
	CampusName string
	// CampusID is the campus's PeeringDB ID for cross-linking.
	CampusID int
}

OrgCampusRow holds display data for an org's campus row.

type OrgCarrierRow

type OrgCarrierRow struct {
	// CarrierName is the carrier name.
	CarrierName string
	// CarrierID is the carrier's PeeringDB ID for cross-linking.
	CarrierID int
}

OrgCarrierRow holds display data for an org's carrier row.

type OrgDetail

type OrgDetail struct {
	// ID is the organization's PeeringDB identifier.
	ID int
	// Name is the organization's display name.
	Name string
	// NameLong is the organization's long-form name.
	NameLong string
	// AKA is the "also known as" alias.
	AKA string
	// Website is the organization's website URL.
	Website string
	// Address1 is the primary street address.
	Address1 string
	// Address2 is the secondary address line.
	Address2 string
	// City is the organization's city.
	City string
	// State is the organization's state or province.
	State string
	// Country is the organization's country code.
	Country string
	// Zipcode is the postal code.
	Zipcode string
	// Notes contains freeform notes.
	Notes string
	// Status is the record status.
	Status string
	// NetCount is the pre-computed count of networks.
	NetCount int
	// FacCount is the pre-computed count of facilities.
	FacCount int
	// IXCount is the count of IXPs (requires query).
	IXCount int
	// CampusCount is the count of campuses (requires query).
	CampusCount int
	// CarrierCount is the count of carriers (requires query).
	CarrierCount int
	// Networks holds eager-loaded network rows for terminal/JSON rendering. Nil for web UI requests.
	Networks []OrgNetworkRow `json:"networks,omitempty"`
	// IXPs holds eager-loaded IXP rows for terminal/JSON rendering. Nil for web UI requests.
	IXPs []OrgIXRow `json:"ixps,omitempty"`
	// Facs holds eager-loaded facility rows for terminal/JSON rendering. Nil for web UI requests.
	Facs []OrgFacilityRow `json:"facilities,omitempty"`
	// Campuses holds eager-loaded campus rows for terminal/JSON rendering. Nil for web UI requests.
	Campuses []OrgCampusRow `json:"campuses,omitempty"`
	// Carriers holds eager-loaded carrier rows for terminal/JSON rendering. Nil for web UI requests.
	Carriers []OrgCarrierRow `json:"carriers,omitempty"`
}

OrgDetail holds display data for an organization detail page.

type OrgFacilityRow

type OrgFacilityRow struct {
	// FacName is the facility name.
	FacName string
	// FacID is the facility's PeeringDB ID for cross-linking.
	FacID int
	// City is the facility's city.
	City string
	// Country is the facility's country code.
	Country string
	// Latitude is the facility's geographic latitude. Zero means no data.
	Latitude float64
	// Longitude is the facility's geographic longitude. Zero means no data.
	Longitude float64
}

OrgFacilityRow holds display data for an org's facility row.

type OrgIXRow

type OrgIXRow struct {
	// IXName is the exchange name.
	IXName string
	// IXID is the exchange's PeeringDB ID for cross-linking.
	IXID int
}

OrgIXRow holds display data for an org's IXP row.

type OrgNetworkRow

type OrgNetworkRow struct {
	// NetName is the network's name.
	NetName string
	// ASN is the network's Autonomous System Number.
	ASN int
}

OrgNetworkRow holds display data for an org's network row.

type PrivacySync added in v1.14.0

type PrivacySync struct {
	// AuthMode is the human-readable label: "Authenticated with PeeringDB
	// API key" or "Anonymous (no key)".
	AuthMode string

	// PublicTier is the lowercase env-var value: "public" or "users".
	// Matches PDBPLUS_PUBLIC_TIER so operators can map the UI back to the
	// deploy config without translating.
	PublicTier string

	// PublicTierExplanation is the one-line plain-language gloss of what
	// PublicTier means for an anonymous caller's data view. Rendered below
	// the PublicTier value on both surfaces.
	PublicTierExplanation string

	// OverrideActive is true when PublicTier == "users". When true, the
	// HTML renders an amber "Override active" badge and the terminal
	// prepends a "! " indicator to the Public Tier line.
	OverrideActive bool
}

PrivacySync carries the Privacy & Sync section payload for both the HTML (about.templ) and terminal (termrender/about.go) About page renderings. Populated by web.Handler.handleAbout from the handler's captured startup values; the renderers do not read env vars or config at request time.

OverrideActive is true iff PDBPLUS_PUBLIC_TIER=users was in effect at process start — the "never silent escalation" flag.

type SearchGroup

type SearchGroup struct {
	// TypeName is the human-readable plural name (e.g. "Networks", "IXPs").
	TypeName string
	// TypeSlug is the short identifier used in URLs (e.g. "net", "ix").
	TypeSlug string
	// AccentColor is the Tailwind color name for visual grouping (e.g. "emerald", "sky").
	AccentColor string
	// Results holds up to 10 matching entities.
	Results []SearchResult
	// HasMore indicates whether additional matches exist beyond the displayed results.
	HasMore bool
	// Total is the exact number of matches across all pages. Equals len(Results)
	// when HasMore is false; drives the "View all N" link when HasMore is true.
	Total int
}

SearchGroup represents a group of search results for one entity type. These types mirror web.TypeResult and web.SearchHit, defined in the templates package to avoid circular imports (web imports templates, so templates cannot import web).

type SearchResult

type SearchResult struct {
	// Name is the entity's display name.
	Name string
	// Country is the ISO 3166-1 alpha-2 code; empty if not available.
	Country string
	// City is the city name; empty if not available.
	City string
	// ASN is the AS number; 0 if not applicable (non-network entity).
	ASN int
	// DetailURL is the path to the entity's detail page (e.g. "/ui/asn/13335").
	DetailURL string
}

SearchResult represents a single search hit for template rendering.

type SearchTypeView added in v1.20.0

type SearchTypeView struct {
	// TypeName is the human-readable plural name (e.g. "Networks").
	TypeName string
	// TypeSlug is the short identifier used in URLs (e.g. "net").
	TypeSlug string
	// AccentColor is the Tailwind color name for visual grouping.
	AccentColor string
	// Query is the search term, echoed in the header and pagination links.
	Query string
	// Total is the exact number of matches across all pages.
	Total int
	// Hits holds this page's matching entities.
	Hits []SearchResult
	// HasMore indicates whether matches exist beyond this page.
	HasMore bool
	// NextOffset is the offset for the next "Load more" request.
	NextOffset int
}

SearchTypeView holds the data for one page of the per-type "view all" results page (and its "Load more" fragment). It mirrors web.SearchTypeResult but lives in the templates package to avoid a web -> templates import cycle.

Jump to

Keyboard shortcuts

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