Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path represents the location of an anchor. It is a bounded value that enforces the following constraints: paths are strings that MAY contain any printable ASCII characters except the backslash. The forward slash '/' separates path components.
All paths are relative; there is no way of referencing a parent anchor from its child. This provides a form of capability-based isolation wherein principals are limited to the scope of anchor references in their possession.
A path comprising a single '/' is the "root" path. The root path designates the current anchor. Equivalently, it can be said that the root path is the identity function over anchors, or that the Anchor.Walk() method is a nop when the root path is passed in as an argument. The empty string automatically resolves to the root path. Zero-value paths are also treated as root, but are used as as a safe default when the path contains an error, and therefore are NOT RECOMMENDED.
func JoinPath ¶
JoinPath joins each element of 'parts' into a single path, with each element separated by '/'. Each element of 'parts' is validated before being joined. An element is valid if it is a valid path, and does not contain the path separator.
Callers SHOULD check Path.Err() before proceeding.
func NewPath ¶
NewPath returns a new Path value, containing a canonical path if the 'path' argument is valid, or an error if it is not.
Callers SHOULD check Path.Err() before proceeding.