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

Method IDs

pkg/database/ent/machine_query.go:206–215  ·  view source on GitHub ↗

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

(ctx context.Context)

Source from the content-addressed store, hash-verified

204
205// IDs executes the query and returns a list of Machine IDs.
206func (_q *MachineQuery) IDs(ctx context.Context) (ids []int, err error) {
207 if _q.ctx.Unique == nil && _q.path != nil {
208 _q.Unique(true)
209 }
210 ctx = setContextOp(ctx, _q.ctx, ent.OpQueryIDs)
211 if err = _q.Select(machine.FieldID).Scan(ctx, &ids); err != nil {
212 return nil, err
213 }
214 return ids, nil
215}
216
217// IDsX is like IDs, but panics if an error occurs.
218func (_q *MachineQuery) 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