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

Method QueryAllowlistItems

pkg/database/ent/client.go:596–609  ·  view source on GitHub ↗

QueryAllowlistItems queries the allowlist_items edge of a AllowList.

(_m *AllowList)

Source from the content-addressed store, hash-verified

594
595// QueryAllowlistItems queries the allowlist_items edge of a AllowList.
596func (c *AllowListClient) QueryAllowlistItems(_m *AllowList) *AllowListItemQuery {
597 query := (&AllowListItemClient{config: c.config}).Query()
598 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
599 id := _m.ID
600 step := sqlgraph.NewStep(
601 sqlgraph.From(allowlist.Table, allowlist.FieldID, id),
602 sqlgraph.To(allowlistitem.Table, allowlistitem.FieldID),
603 sqlgraph.Edge(sqlgraph.M2M, false, allowlist.AllowlistItemsTable, allowlist.AllowlistItemsPrimaryKey...),
604 )
605 fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)
606 return fromV, nil
607 }
608 return query
609}
610
611// Hooks returns the client hooks.
612func (c *AllowListClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 2

DialectMethod · 0.80
QueryMethod · 0.45

Tested by

no test coverage detected