add convenience method
This commit is contained in:
@@ -44,6 +44,15 @@ func (s *EventSubgraph) NodesByLabel(label string) []*Node {
|
|||||||
return nodes
|
return nodes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *EventSubgraph) FirstNodesByLabel(label string) *Node {
|
||||||
|
for _, node := range s.nodes {
|
||||||
|
if node.Labels.Contains(label) {
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
|
|
||||||
func isValidTag(t roots.Tag) bool {
|
func isValidTag(t roots.Tag) bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user