foresttest

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(desc string) *forest.Forest

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`

func CreateSecret

func CreateSecret(nm, nsn string, f *forest.Forest)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL