TagGraph is a graph like data structure for creating tag hierarchies in Go apps.
You can:
- Add/remove tags/edges to the graph at run time
- Get a list of all possible paths leading to the selected tag.
- Get all the parent tags of the selected tag
- Get all the child tags of the selected tag
-- import "github.com/ckaznocha/taggraph"
type TagGrapher interface {
GetTag(name string) (Tagger, bool)
SetTag(name string)
Delete(name string)
AddChildToTag(child, parent string)
RemoveChildFromTag(child, parent string)
}
TagGrapher is an interface for graph like collection of tags
func NewTagGaph() TagGraphercan
NewTagGaph returns a TagGrapher
type Tagger interface {
Children() []string
Parents() []string
PathsToAllAncestors() [][]string
PathsToAllAncestorsAsString(delim string) []string
Name() string
}
Tagger is an interface for interacting with a node of a TagGrapher