Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create creates a forest with len(desc) namespaces, consecutively named a, b, etc. Each entry in the string defines both who the parent of the respective namespace is, as well as whether it's a subnamespace as well: * If the string element is a hyphen ('-'), the namespace is a root. * If the string element is a lowercase letter, the referenced namespace is a normal parent.
- If the referenced namespace is not in len(desc), it will not exist and we'll set ParentMissing on the child.
* If the string element is an uppercase letter, that namespaces will be the parent and the *current* namespace will be a subnamespace.
Examples:
- "-" -> creates a single namespace "a" that is a root
- "-a" -> creates the tree a <- b
- "-A" -> creates the tree a <- b where b is a subnamespace of a
- "z" -> creates the tree z <- a where z does not exist and a has ParentMissing
- "-aa" -> creates namespace `a` with two children, `b` and `c`
- "-aA" -> as above, but c is a subnamespace and b is a full namespace
- "ba" -> creates a cycle
- "-aa-dd" -> creates two trees, one with root `a` and children `b` and `c`, the other with root `d` and children `e` and `f`
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.