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

Method Count

pkg/database/ent/meta_query.go:226–232  ·  view source on GitHub ↗

Count returns the count of the given query.

(ctx context.Context)

Source from the content-addressed store, hash-verified

224
225// Count returns the count of the given query.
226func (_q *MetaQuery) Count(ctx context.Context) (int, error) {
227 ctx = setContextOp(ctx, _q.ctx, ent.OpQueryCount)
228 if err := _q.prepareQuery(ctx); err != nil {
229 return 0, err
230 }
231 return withInterceptors[int](ctx, _q, querierCount[*MetaQuery](), _q.inters)
232}
233
234// CountX is like Count, but panics if an error occurs.
235func (_q *MetaQuery) CountX(ctx context.Context) int {

Callers 6

CountXMethod · 0.95
TotalAlertsMethod · 0.45
QueryAlertWithFilterMethod · 0.45
CountDecisionsByValueMethod · 0.45
CountFunction · 0.45
CAPIPullIsOldMethod · 0.45

Calls 2

prepareQueryMethod · 0.95
setContextOpFunction · 0.85

Tested by

no test coverage detected