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

Method QueryEvents

pkg/database/ent/client.go:431–444  ·  view source on GitHub ↗

QueryEvents queries the events edge of a Alert.

(_m *Alert)

Source from the content-addressed store, hash-verified

429
430// QueryEvents queries the events edge of a Alert.
431func (c *AlertClient) QueryEvents(_m *Alert) *EventQuery {
432 query := (&EventClient{config: c.config}).Query()
433 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
434 id := _m.ID
435 step := sqlgraph.NewStep(
436 sqlgraph.From(alert.Table, alert.FieldID, id),
437 sqlgraph.To(event.Table, event.FieldID),
438 sqlgraph.Edge(sqlgraph.O2M, false, alert.EventsTable, alert.EventsColumn),
439 )
440 fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)
441 return fromV, nil
442 }
443 return query
444}
445
446// QueryMetas queries the metas edge of a Alert.
447func (c *AlertClient) QueryMetas(_m *Alert) *MetaQuery {

Callers

nothing calls this directly

Calls 2

DialectMethod · 0.80
QueryMethod · 0.45

Tested by

no test coverage detected