mirror of
https://github.com/hanzoai/namespace.git
synced 2026-09-30 22:57:59 +00:00
The fleet stores OLTP data as one SQLite file per entity, and the name of that file is a path -- <dir>/<ns>.db locally, a key prefix in object storage. orm/db canonicalised it with path.Clean plus "must begin with a letter", which leaves a namespace an opaque string that every consumer re-derives structure from and re-validates: orm/replicated re-split and re-checked each segment, commerce/db has splitTenant. So make it a value. Namespace wraps an unexported string, the only routes to one are the constructors and Parse, and the shape is kind[/id][/group]. Segments are [a-z0-9][a-z0-9_-]*, which leaves no spelling of a separator, a dot-segment or a hidden name to reject later, and ids fold to lowercase because on a case-insensitive filesystem org/Acme and org/acme are two namespaces over one file. This package is what a namespace IS; orm/db.Namespaces resolves one to a handle. Co-authored-by: Hanzo Dev <[email protected]>
4 lines
47 B
AMPL
4 lines
47 B
AMPL
module github.com/hanzoai/namespace
|
|
|
|
go 1.26.5
|