Versions in this module Expand all Collapse all v2 v2.0.2 Oct 2, 2023 v2.0.1 May 18, 2023 Changes in this version type Graph + func (g *Graph) FastNewEdge(from, to *Node, label string, props map[string]any) *Edge + func (g *Graph) FastNewNode(labels StringSet, props map[string]interface{}) *Node v2.0.0 Mar 30, 2023 Changes in this version + func CheckIsomorphism(g1, g2 *Graph, nodeEquivalenceFunc func(n1, n2 *Node) bool, ...) bool + func CollectAllPaths(graph *Graph, fromNode *Node, firstLeg EdgeIterator, ...) + func ComparePropertyValue(a, b interface{}) int + func CopyGraph(source, target *Graph, clonePropertyFunc func(string, interface{}) interface{}) map[*Node]*Node + func CopyGraphf(source *Graph, copyNodeFunc func(*Node, map[*Node]*Node) *Node, ...) map[*Node]*Node + func CopySubgraph(sourceNode *Node, target *Graph, ...) + func DefaultDOTEdgeRender(fromNode, toNode string, edge *Edge, w io.Writer) error + func DefaultDOTNodeRender(ID string, node *Node, w io.Writer) error + func ForEachNode(g *Graph, predicate func(*Node) bool) bool + func GetEdgeFilterFunc(labels StringSet, properties map[string]interface{}) func(*Edge) bool + func GetNodeFilterFunc(labels StringSet, properties map[string]interface{}) func(*Node) bool + type Cursor struct + func (c *Cursor) Backward() EdgeIterator + func (c *Cursor) BackwardWith(label string) EdgeIterator + func (c *Cursor) Edges(dir EdgeDir) EdgeIterator + func (c *Cursor) EdgesWith(dir EdgeDir, label string) EdgeIterator + func (c *Cursor) Forward() EdgeIterator + func (c *Cursor) ForwardWith(label string) EdgeIterator + func (c *Cursor) GetPath() *Path + func (c *Cursor) NextNodes() NodeIterator + func (c *Cursor) NextNodesWith(label string) NodeIterator + func (c *Cursor) Nodes(dir EdgeDir) NodeIterator + func (c *Cursor) NodesWith(dir EdgeDir, label string) NodeIterator + func (c *Cursor) PopFromPath() *Cursor + func (c *Cursor) PrevNodes() NodeIterator + func (c *Cursor) PrevNodesWith(label string) NodeIterator + func (c *Cursor) PushToPath(edge *Edge) *Cursor + func (c *Cursor) Set(node *Node) *Cursor + func (c *Cursor) StartPath() *Cursor + type DOTRenderer struct + EdgeRenderer func(fromID string, toID string, edge *Edge, w io.Writer) (bool, error) + NodeRenderer func(string, *Node, io.Writer) (bool, error) + func (d DOTRenderer) Render(g *Graph, graphName string, out io.Writer) error + func (d DOTRenderer) RenderEdge(fromID, toID string, edge *Edge, w io.Writer) (bool, error) + func (d DOTRenderer) RenderNode(ID string, node *Node, w io.Writer) (bool, error) + func (d DOTRenderer) RenderNodesEdges(g *Graph, out io.Writer) error + type DefaultMatchAccumulator struct + Paths []*Path + Symbols []map[string]interface{} + func (acc *DefaultMatchAccumulator) GetHeadNodes() []*Node + func (acc *DefaultMatchAccumulator) GetTailNodes() []*Node + func (acc *DefaultMatchAccumulator) StoreResult(_ *MatchContext, path *Path, symbols map[string]interface{}) + type Edge struct + func CloneEdge(from, to *Node, edge *Edge, target *Graph, ...) *Edge + func CopyEdge(edge *Edge, target *Graph, ...) *Edge + func EdgeSlice(in EdgeIterator) []*Edge + func EdgesBetweenNodes(from, to *Node) []*Edge + func (edge *Edge) ForEachProperty(f func(string, interface{}) bool) bool + func (edge *Edge) GetFrom() *Node + func (edge *Edge) GetGraph() *Graph + func (edge *Edge) GetID() int + func (edge *Edge) GetLabel() string + func (edge *Edge) GetProperty(key string) (interface{}, bool) + func (edge *Edge) GetTo() *Node + func (edge *Edge) MarshalJSON() ([]byte, error) + func (edge *Edge) Remove() + func (edge *Edge) RemoveProperty(key string) + func (edge *Edge) SetLabel(label string) + func (edge *Edge) SetProperty(key string, value interface{}) + func (edge *Edge) String() string + type EdgeDir int + const AnyEdge + const IncomingEdge + const OutgoingEdge + type EdgeIterator interface + Edge func() *Edge + type EdgeSet struct + func NewEdgeSet() *EdgeSet + func (set *EdgeSet) Add(edge *Edge) + func (set EdgeSet) Iterator() EdgeIterator + func (set EdgeSet) Len() int + func (set EdgeSet) Remove(edge *Edge) + func (set EdgeSet) Slice() []*Edge + type ErrEdgeVariableExpected string + func (e ErrEdgeVariableExpected) Error() string + type ErrInvalidGraph struct + Msg string + func (e ErrInvalidGraph) Error() string + type ErrNodeVariableExpected string + func (e ErrNodeVariableExpected) Error() string + type Graph struct + func NewGraph() *Graph + func (g *Graph) AddEdgePropertyIndex(propertyName string, ix IndexType) + func (g *Graph) AddNodePropertyIndex(propertyName string, ix IndexType) + func (g *Graph) FindEdges(labels StringSet, properties map[string]interface{}) EdgeIterator + func (g *Graph) FindNodes(allLabels StringSet, properties map[string]interface{}) NodeIterator + func (g *Graph) GetEdges() EdgeIterator + func (g *Graph) GetEdgesWithAnyLabel(set StringSet) EdgeIterator + func (g *Graph) GetEdgesWithProperty(property string) EdgeIterator + func (g *Graph) GetNodes() NodeIterator + func (g *Graph) GetNodesWithAllLabels(labels StringSet) NodeIterator + func (g *Graph) GetNodesWithProperty(property string) NodeIterator + func (g *Graph) NewEdge(from, to *Node, label string, props map[string]interface{}) *Edge + func (g *Graph) NewNode(labels []string, props map[string]interface{}) *Node + func (g *Graph) NumEdges() int + func (g *Graph) NumNodes() int + type IndexType int + const BtreeIndex + const HashIndex + type Interner interface + Intern func(string) string + type Iterator interface + MaxSize func() int + Next func() bool + Value func() interface{} + func MultiIterator(iterators ...Iterator) Iterator + type JSON struct + Interner Interner + MarshalEdgesSeparately bool + PropertyMarshaler func(key string, value interface{}) (string, json.RawMessage, error) + PropertyUnmarshaler func(key string, value json.RawMessage) (string, interface{}, error) + func (j JSON) Decode(g *Graph, input *json.Decoder) error + func (j JSON) Encode(g *Graph, out io.Writer) error + type MapInterner map[string]string + func (i MapInterner) Intern(s string) string + type MatchAccumulator interface + StoreResult func(ctx *MatchContext, path *Path, symbols map[string]interface{}) + type MatchContext struct + Graph *Graph + LocalSymbols map[string]*PatternSymbol + Symbols map[string]*PatternSymbol + type MatchPlan struct + func (plan MatchPlan) CaptureSymbolValues() map[string]interface{} + func (plan MatchPlan) GetCurrentPath() *Path + func (plan MatchPlan) Run(graph *Graph, symbols map[string]*PatternSymbol, result MatchAccumulator) error + type Node struct + func CopyNode(sourceNode *Node, target *Graph, ...) *Node + func NextNodesWith(source *Node, label string) []*Node + func NodeSlice(in NodeIterator) []*Node + func PrevNodesWith(source *Node, label string) []*Node + func Sinks(graph *Graph) []*Node + func SourceNodes(in EdgeIterator) []*Node + func Sources(graph *Graph) []*Node + func TargetNodes(in EdgeIterator) []*Node + func (node *Node) Detach() + func (node *Node) DetachAndRemove() + func (node *Node) ForEachProperty(f func(string, interface{}) bool) bool + func (node *Node) GetEdges(dir EdgeDir) EdgeIterator + func (node *Node) GetEdgesWithAnyLabel(dir EdgeDir, labels StringSet) EdgeIterator + func (node *Node) GetEdgesWithLabel(dir EdgeDir, label string) EdgeIterator + func (node *Node) GetGraph() *Graph + func (node *Node) GetID() int + func (node *Node) GetLabels() StringSet + func (node *Node) GetProperty(key string) (interface{}, bool) + func (node *Node) HasLabel(s string) bool + func (node *Node) MarshalJSON() ([]byte, error) + func (node *Node) RemoveProperty(key string) + func (node *Node) SetLabels(labels StringSet) + func (node *Node) SetProperty(key string, value interface{}) + func (node *Node) String() string + type NodeIterator interface + Node func() *Node + func SinksItr(graph *Graph) NodeIterator + func SourcesItr(graph *Graph) NodeIterator + type NodeMap struct + func NewNodeMap() *NodeMap + func (nm *NodeMap) Add(node *Node) + func (nm *NodeMap) Replace(node *Node, oldLabels, newLabels StringSet) + func (nm NodeMap) IsEmpty() bool + func (nm NodeMap) Iterator() NodeIterator + func (nm NodeMap) IteratorAllLabels(labels StringSet) NodeIterator + func (nm NodeMap) Remove(node *Node) + type NodeSet struct + func NewNodeSet() *NodeSet + func (set *NodeSet) Add(node *Node) + func (set NodeSet) Has(node *Node) bool + func (set NodeSet) Iterator() NodeIterator + func (set NodeSet) Len() int + func (set NodeSet) Remove(node *Node) + func (set NodeSet) Slice() []*Node + type Path struct + func NewPathFromElements(elements ...PathElement) *Path + func PathFromNode(node *Node) *Path + func (p *Path) Append(path ...PathElement) *Path + func (p *Path) AppendPath(path *Path) *Path + func (p *Path) Clear() *Path + func (p *Path) Clone() *Path + func (p *Path) First() *Node + func (p *Path) GetEdge(n int) *Edge + func (p *Path) GetNode(n int) *Node + func (p *Path) HasPrefix(p1 []PathElement) bool + func (p *Path) HasPrefixPath(p1 *Path) bool + func (p *Path) IsEmpty() bool + func (p *Path) Last() *Node + func (p *Path) NumEdges() int + func (p *Path) NumNodes() int + func (p *Path) RemoveFirst() *Path + func (p *Path) RemoveLast() *Path + func (p *Path) SetOnlyNode(node *Node) *Path + func (p *Path) Slice(startNodeIndex, endNodeIndex int) *Path + func (p *Path) String() string + type PathElement struct + Edge *Edge + Reverse bool + func NewPathElementsFromEdges(edges []*Edge) []PathElement + func (p PathElement) GetSourceNode() *Node + func (p PathElement) GetTargetNode() *Node + type Pattern []PatternItem + func (pattern Pattern) FindNodes(graph *Graph, symbols map[string]*PatternSymbol) ([]*Node, error) + func (pattern Pattern) FindPaths(graph *Graph, symbols map[string]*PatternSymbol) (DefaultMatchAccumulator, error) + func (pattern Pattern) GetPlan(graph *Graph, symbols map[string]*PatternSymbol) (MatchPlan, error) + func (pattern Pattern) GetSymbolNames() StringSet + func (pattern Pattern) Run(graph *Graph, symbols map[string]*PatternSymbol, result MatchAccumulator) error + type PatternItem struct + Labels StringSet + Max int + Min int + Name string + Properties map[string]interface{} + ToLeft bool + Undirected bool + type PatternSymbol struct + Edges *EdgeSet + Nodes *NodeSet + func (p *PatternSymbol) Add(item interface{}) bool + func (p *PatternSymbol) AddNode(item *Node) + func (p *PatternSymbol) AddPath(path *Path) + func (p *PatternSymbol) EdgeSlice() *Path + func (p *PatternSymbol) NodeSlice() []*Node + type StringSet struct + M map[string]struct{} + func NewStringSet(s ...string) StringSet + func (set *StringSet) Add(s ...string) *StringSet + func (set *StringSet) AddSet(s StringSet) *StringSet + func (set *StringSet) Remove(s ...string) *StringSet + func (set *StringSet) UnmarshalJSON(in []byte) error + func (set StringSet) Clone() StringSet + func (set StringSet) Has(s string) bool + func (set StringSet) HasAll(s ...string) bool + func (set StringSet) HasAllSet(s StringSet) bool + func (set StringSet) HasAny(s ...string) bool + func (set StringSet) HasAnySet(s StringSet) bool + func (set StringSet) IsEqual(s StringSet) bool + func (set StringSet) Len() int + func (set StringSet) MarshalJSON() ([]byte, error) + func (set StringSet) Slice() []string + func (set StringSet) SortedSlice() []string + func (set StringSet) String() string + type WithNativeValue interface + GetNativeValue func() interface{} + type WithProperties interface + GetProperty func(key string) (interface{}, bool) Other modules containing this package github.com/cloudprivacylabs/lpg