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

Method QueryAllowlist

pkg/database/ent/client.go:745–758  ·  view source on GitHub ↗

QueryAllowlist queries the allowlist edge of a AllowListItem.

(_m *AllowListItem)

Source from the content-addressed store, hash-verified

743
744// QueryAllowlist queries the allowlist edge of a AllowListItem.
745func (c *AllowListItemClient) QueryAllowlist(_m *AllowListItem) *AllowListQuery {
746 query := (&AllowListClient{config: c.config}).Query()
747 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
748 id := _m.ID
749 step := sqlgraph.NewStep(
750 sqlgraph.From(allowlistitem.Table, allowlistitem.FieldID, id),
751 sqlgraph.To(allowlist.Table, allowlist.FieldID),
752 sqlgraph.Edge(sqlgraph.M2M, true, allowlistitem.AllowlistTable, allowlistitem.AllowlistPrimaryKey...),
753 )
754 fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)
755 return fromV, nil
756 }
757 return query
758}
759
760// Hooks returns the client hooks.
761func (c *AllowListItemClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 2

DialectMethod · 0.80
QueryMethod · 0.45

Tested by

no test coverage detected