Documentation
¶
Overview ¶
Package mapsslug owns the namespaced slug grammar for offline-map downloads. Both pkg/webapi and pkg/mapscache import this package, so the regex, length cap, and forbidden-country list live in exactly one place.
Grammar:
state/<state-slug> country/<iso2> (iso2 != cn|ru) province/<iso2>/<slug> (iso2 != cn|ru)
state-slug and province-slug: ^[a-z][a-z0-9-]{0,49}$ iso2: ^[a-z]{2}$
The grammar is deliberately strict so an attacker cannot reach R2 or the local cache filesystem with a path-traversal payload. Catalog membership is checked separately against the live catalog.
Index ¶
Constants ¶
View Source
const MaxLen = 80
Variables ¶
This section is empty.
Functions ¶
func LeafRegexp ¶
LeafRegexp returns the slug-leaf regex for callers that need to apply it to a non-namespaced string (e.g. legacy on-disk filenames during migration).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.