Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownSearchType = catalog.ErrUnknownSearchType
var StaticFS, _ = fs.Sub(staticFiles, "static")
StaticFS provides access to embedded static files (htmx.min.js, etc.) with the "static/" prefix stripped so files are served at their base names.
Functions ¶
This section is empty.
Types ¶
type CompareInput ¶
type CompareInput = catalog.CompareInput
CompareInput parameterizes a network comparison.
type CompareService ¶
type CompareService = catalog.CompareService
CompareService compares two networks through the catalog service.
func NewCompareService ¶
func NewCompareService(client *ent.Client) *CompareService
NewCompareService creates a catalog-backed comparison service.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves web UI pages.
func NewHandler ¶
func NewHandler(in NewHandlerInput) *Handler
NewHandler creates a web UI handler with integrated search and compare services. Diagnostic values are captured at construction and surface on /ui/about. The input uses named fields so callers cannot transpose them.
type NewHandlerInput ¶ added in v1.14.0
type NewHandlerInput struct {
Client *ent.Client
DB *sql.DB
AuthMode string
PublicTier privctx.Tier
Version string
Region string
}
NewHandlerInput configures a web Handler. Client is required; DB may be nil for tests that do not exercise the sync-status table. AuthMode and PublicTier feed the /ui/about Privacy & Sync section. Version and Region feed its optional Application section. When AuthMode is empty, the renderer falls back to "anonymous"; when PublicTier is the zero value (TierPublic), no override flag is shown.
type PageContent ¶
type PageContent struct {
Title string
Kind PageKind // Kind routes the special pages in terminal/JSON modes (zero value = ordinary page).
Description string // Description feeds the meta description / og:description tags when non-empty.
Canonical string // Canonical feeds the rel=canonical link / og:url tags when non-empty.
Content templ.Component
Data any // Raw data struct for terminal/JSON rendering. Nil for pages without entity data.
Freshness time.Time // Freshness is the last successful sync time for terminal footer display.
Status int // HTTP status (0 means 200). Committed by renderPage AFTER headers — WriteHeader first drops Vary/Content-Type.
NeedsMap bool // NeedsMap emits the Leaflet/markercluster head includes; set only on pages that render a MapContainer.
}
PageContent holds the title and body component for a page render. Defined to avoid >2 non-ctx arguments in renderPage.
type PageKind ¶ added in v1.23.0
type PageKind int
PageKind identifies the special pages renderPage must format differently in terminal/JSON modes. It exists so that dispatch keys on an explicit field: "Home" and "Not Found" are legal entity names, so switching on Title would misroute a network that happens to carry one of those names.
type SearchService ¶
type SearchService struct {
// contains filtered or unexported fields
}
SearchService adapts protocol-neutral catalog searches for web presentation.
func NewSearchService ¶
func NewSearchService(client *ent.Client) *SearchService
NewSearchService creates a web search adapter backed by client.
func (*SearchService) Search ¶
func (s *SearchService) Search(ctx context.Context, query string) ([]TypeResult, error)
Search queries all catalog entity types and adds web presentation metadata.
func (*SearchService) SearchType ¶ added in v1.20.0
func (s *SearchService) SearchType(ctx context.Context, in SearchTypeInput) (SearchTypeResult, error)
SearchType queries one catalog entity type and adds web presentation metadata.
type SearchTypeInput ¶ added in v1.20.0
type SearchTypeInput = catalog.SearchTypeInput
SearchTypeInput parameterizes a single-type paginated search.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
templ: version: v0.3.1020
|
templ: version: v0.3.1020 |
|
Package termrender provides terminal client detection and ANSI text rendering for serving styled text responses to CLI clients like curl, wget, and HTTPie.
|
Package termrender provides terminal client detection and ANSI text rendering for serving styled text responses to CLI clients like curl, wget, and HTTPie. |