Documentation ¶
Index ¶
- func Find(slice []string, f func(string) bool) (string, bool)
- func Inits(in []string) [][]string
- func JoinTerms(s []string) string
- func Prefixes(in string) (out []string)
- func SplitTerms(in string) []string
- func TraverseUntilModule(g *graph.Graph, id string) bool
- func VertexSplit(g *graph.Graph, s string) (string, string, bool)
- func VertexSplitTraverse(g *graph.Graph, toFind string, startingNode string, ...) (string, string, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Prefixes ¶
Prefixes returns a set of prefixes for a string, e.g. "a.b.c.d" will yield []string{"a.b.c.d","a.b.c","a.b.","a"}
func SplitTerms ¶
SplitTerms takes a string and splits it on '.'
func TraverseUntilModule ¶
TraverseUntilModule is a function intended to be used with VertexSplitTraverse and will cause vertex splitting to propogate upwards until it encounters a module
func VertexSplit ¶
VertexSplit takes a graph with a set of vertexes and a string, and returns the longest vertex id from the graph and the remainder of the string. If no matching vertex is found 'false' is returned.
func VertexSplitTraverse ¶
func VertexSplitTraverse(g *graph.Graph, toFind string, startingNode string, stop func(*graph.Graph, string) bool, history map[string]struct{}) (string, string, bool)
VertexSplitTraverse will act like vertex split, looking for a prefix matching the current set of graph nodes, however unlike `VertexSplit`, if a node is not found at the current level it will look at the parent level to the provided starting node, unless stop(parent) returns true.
Types ¶
This section is empty.