MCPcopy
hub / github.com/crowdsecurity/crowdsec / QueryDecisions

Method QueryDecisions

pkg/database/ent/client.go:415–428  ·  view source on GitHub ↗

QueryDecisions queries the decisions edge of a Alert.

(_m *Alert)

Source from the content-addressed store, hash-verified

413
414// QueryDecisions queries the decisions edge of a Alert.
415func (c *AlertClient) QueryDecisions(_m *Alert) *DecisionQuery {
416 query := (&DecisionClient{config: c.config}).Query()
417 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
418 id := _m.ID
419 step := sqlgraph.NewStep(
420 sqlgraph.From(alert.Table, alert.FieldID, id),
421 sqlgraph.To(decision.Table, decision.FieldID),
422 sqlgraph.Edge(sqlgraph.O2M, false, alert.DecisionsTable, alert.DecisionsColumn),
423 )
424 fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)
425 return fromV, nil
426 }
427 return query
428}
429
430// QueryEvents queries the events edge of a Alert.
431func (c *AlertClient) QueryEvents(_m *Alert) *EventQuery {

Callers

nothing calls this directly

Calls 2

DialectMethod · 0.80
QueryMethod · 0.45

Tested by

no test coverage detected