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

Method IDs

pkg/database/ent/alert_query.go:279–288  ·  view source on GitHub ↗

IDs executes the query and returns a list of Alert IDs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

277
278// IDs executes the query and returns a list of Alert IDs.
279func (_q *AlertQuery) IDs(ctx context.Context) (ids []int, err error) {
280 if _q.ctx.Unique == nil && _q.path != nil {
281 _q.Unique(true)
282 }
283 ctx = setContextOp(ctx, _q.ctx, ent.OpQueryIDs)
284 if err = _q.Select(alert.FieldID).Scan(ctx, &ids); err != nil {
285 return nil, err
286 }
287 return ids, nil
288}
289
290// IDsX is like IDs, but panics if an error occurs.
291func (_q *AlertQuery) IDsX(ctx context.Context) []int {

Callers 3

IDsXMethod · 0.95
FirstIDMethod · 0.45
OnlyIDMethod · 0.45

Calls 4

UniqueMethod · 0.95
SelectMethod · 0.95
setContextOpFunction · 0.85
ScanMethod · 0.45

Tested by

no test coverage detected