route

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: LGPL-2.1 Imports: 1 Imported by: 0

README

mod/route

mod/route contains stable service route constants shared by server, source discovery, tests, and generated-facing helpers. It prevents packages from spelling /health, /info, OpenAPI, metrics, logo, and similar routes differently.

Place in the Runtime

flowchart LR
  source["source discovery"] --> route["mod/route"]
  server["server hooks"] --> route
  tests["tests"] --> route
  route --> paths["service paths"]

Responsibilities

  • Define service-level routes that are independent of a package key or version.
  • Keep discovery probes and server handlers aligned.
  • Provide one place to audit routes that are expected to be stable across deployments.

Contracts

  • Route constants are path-only strings beginning with /.
  • Package-manager routes that depend on {key} or {version} stay with their domain builder.
  • Adding a new public service route should update this package, the server handler, and the relevant README.

Important Files

  • route.go: service route constants.

Usage Notes

Do not put helper functions here unless they are shared by more than one package. Most URL building belongs in mod/server/link because it needs listener, scheme, prefix, and host context.

Documentation

Index

Constants

View Source
const (
	// Health defines the live status path for the entry channel.
	Health = "/health"

	// Info defines the node's public card path.
	Info = "/info"

	// Metrics defines the root path for the metrics HTML index.
	Metrics = "/metrics"

	// OpenAPI defines the JSON spec path.
	OpenAPI = "/openapi.json"
)
View Source
const (
	// MetricsCache defines the cache metrics group path.
	MetricsCache = Metrics + "/cache"

	// MetricsCore defines the core metrics group path.
	MetricsCore = Metrics + "/core"

	// MetricsErrors defines the errors metrics group path.
	MetricsErrors = Metrics + "/errors"

	// MetricsInternal defines the full OpenMetrics exposition path.
	MetricsInternal = Metrics + "/internal"

	// MetricsRescan defines the rescan metrics group path.
	MetricsRescan = Metrics + "/rescan"
)

Variables

This section is empty.

Functions

func IsMetrics

func IsMetrics(pathText string) bool

IsMetrics reports whether the path belongs to the metrics tree.

func IsService

func IsService(pathText string) bool

IsService reports whether a root service path must bypass nested static handling.

Types

This section is empty.

Jump to

Keyboard shortcuts

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