Skip to content

TagGraph is a graph like data structure for creating tag hierarchies in Go apps.

License

Notifications You must be signed in to change notification settings

ckaznocha/taggraph

Repository files navigation

TagGraph

Build Status Coverage Status License GoDoc Go Report Card

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"

Usage

type TagGrapher

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

func NewTagGaph() TagGraphercan

NewTagGaph returns a TagGrapher

type Tagger

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

About

TagGraph is a graph like data structure for creating tag hierarchies in Go apps.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages