Documentation ¶
Index ¶
Constants ¶
View Source
const (
RootNamespaceID = "root"
)
Variables ¶
View Source
var ( ErrNoNamespace error = errors.New("no namespace") RootNamespace *Namespace = &Namespace{ ID: RootNamespaceID, Path: "", } )
Functions ¶
func Canonicalize ¶
Canonicalize trims any prefix '/' and adds a trailing '/' to the provided string
func ContextWithNamespace ¶
func SplitIDFromString ¶ added in v0.11.2
Types ¶
type MountPathDetails ¶ added in v1.10.0
MountPathDetails contains the details of a mount's location, consisting of the namespace of the mount and the path of the mount within the namespace
func (*MountPathDetails) GetFullPath ¶ added in v1.10.0
func (mpd *MountPathDetails) GetFullPath() string
func (*MountPathDetails) GetRelativePath ¶ added in v1.10.0
func (mpd *MountPathDetails) GetRelativePath(currNs *Namespace) string
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.