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

Method OnlyX

pkg/database/ent/alert_query.go:223–229  ·  view source on GitHub ↗

OnlyX is like Only, but panics if an error occurs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

221
222// OnlyX is like Only, but panics if an error occurs.
223func (_q *AlertQuery) OnlyX(ctx context.Context) *Alert {
224 node, err := _q.Only(ctx)
225 if err != nil {
226 panic(err)
227 }
228 return node
229}
230
231// OnlyID is like Only, but returns the only Alert ID in the query.
232// Returns a *NotSingularError when more than one Alert ID is found.

Callers

nothing calls this directly

Calls 1

OnlyMethod · 0.95

Tested by

no test coverage detected