pathutil

package
v0.73.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package pathutil hosts the URL-path helpers shared by route registration and tenant resolution. The functions preserve the exact semantics that server/route_registrar.go relied on before extraction, so existing callers behave identically.

Index

Constants

View Source
const SystemPrefix = "/_sys"

SystemPrefix is the framework's system route prefix: the scheduler mounts its job API at <server.path.base>/_sys, and debug.pathprefix defaults to it at the engine root. Under a tenant resolver that may read the path, the server reserves <base>/_sys for framework routes (ADR-168).

Variables

This section is empty.

Functions

func EnsureLeadingSlash

func EnsureLeadingSlash(path string) string

func NormalizePrefix

func NormalizePrefix(prefix string) string

NormalizePrefix produces the canonical form expected by StripPathPrefix: inputs "" and "/" both collapse to "" so an empty prefix never matches a real path.

func StripPathPrefix

func StripPathPrefix(path, prefix string) (string, bool)

StripPathPrefix returns the part of path that follows prefix when path is under prefix (equals it exactly or has "prefix/" as its head), guarding against partial-word matches.

When ok is false, the returned string is the original path unchanged, not "" — callers can pass through StripPathPrefix without losing input.

Types

This section is empty.

Jump to

Keyboard shortcuts

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