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

Method Count

pkg/database/ent/machine_query.go:227–233  ·  view source on GitHub ↗

Count returns the count of the given query.

(ctx context.Context)

Source from the content-addressed store, hash-verified

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

Callers 1

CountXMethod · 0.95

Calls 2

prepareQueryMethod · 0.95
setContextOpFunction · 0.85

Tested by

no test coverage detected