Documentation ¶
Index ¶
Constants ¶
View Source
const (
RootNamespaceID = "root"
)
Variables ¶
View Source
var ( ErrNoNamespace = errors.New("no namespace") RootNamespace = &Namespace{ ID: RootNamespaceID, Path: "", } )
Functions ¶
func Canonicalize ¶
Canonicalize trims any prefix '/' and adds a trailing '/' to the provided string
func ContextWithNamespace ¶
func SplitIDFromString ¶
Types ¶
type Namespace ¶
func FromContext ¶
This function caches the ns to avoid doing a .Value lookup over and over, because it's called a *lot* in the request critical path. .Value is concurrency-safe so uses some kind of locking/atomicity, but it should never be read before first write, plus we don't believe this will be called from different goroutines, so it should be safe.
func (*Namespace) TrimmedPath ¶
Click to show internal directories.
Click to hide internal directories.