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

Method QueryOwner

pkg/database/ent/client.go:399–412  ·  view source on GitHub ↗

QueryOwner queries the owner edge of a Alert.

(_m *Alert)

Source from the content-addressed store, hash-verified

397
398// QueryOwner queries the owner edge of a Alert.
399func (c *AlertClient) QueryOwner(_m *Alert) *MachineQuery {
400 query := (&MachineClient{config: c.config}).Query()
401 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
402 id := _m.ID
403 step := sqlgraph.NewStep(
404 sqlgraph.From(alert.Table, alert.FieldID, id),
405 sqlgraph.To(machine.Table, machine.FieldID),
406 sqlgraph.Edge(sqlgraph.M2O, true, alert.OwnerTable, alert.OwnerColumn),
407 )
408 fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)
409 return fromV, nil
410 }
411 return query
412}
413
414// QueryDecisions queries the decisions edge of a Alert.
415func (c *AlertClient) QueryDecisions(_m *Alert) *DecisionQuery {

Callers

nothing calls this directly

Calls 2

DialectMethod · 0.80
QueryMethod · 0.45

Tested by

no test coverage detected