add convenience method

This commit is contained in:
Jay
2026-05-21 13:23:02 -04:00
parent 96693304e8
commit fc40fd6dd4
+9
View File
@@ -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 {