MCPcopy Create free account
hub / github.com/crowdsecurity/crowdsec / Count

Method Count

pkg/database/ent/alert_query.go:300–306  ·  view source on GitHub ↗

Count returns the count of the given query.

(ctx context.Context)

Source from the content-addressed store, hash-verified

298
299// Count returns the count of the given query.
300func (_q *AlertQuery) Count(ctx context.Context) (int, error) {
301 ctx = setContextOp(ctx, _q.ctx, ent.OpQueryCount)
302 if err := _q.prepareQuery(ctx); err != nil {
303 return 0, err
304 }
305 return withInterceptors[int](ctx, _q, querierCount[*AlertQuery](), _q.inters)
306}
307
308// CountX is like Count, but panics if an error occurs.
309func (_q *AlertQuery) CountX(ctx context.Context) int {

Callers 1

CountXMethod · 0.95

Calls 2

prepareQueryMethod · 0.95
setContextOpFunction · 0.85

Tested by

no test coverage detected