MCPcopy Index your code
hub / github.com/chainloop-dev/chainloop / FirstID

Method FirstID

app/controlplane/pkg/data/ent/user_query.go:137–147  ·  view source on GitHub ↗

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

(ctx context.Context)

Source from the content-addressed store, hash-verified

135// FirstID returns the first User ID from the query.
136// Returns a *NotFoundError when no User ID was found.
137func (_q *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error) {
138 var ids []uuid.UUID
139 if ids, err = _q.Limit(1).IDs(setContextOp(ctx, _q.ctx, ent.OpQueryFirstID)); err != nil {
140 return
141 }
142 if len(ids) == 0 {
143 err = &NotFoundError{user.Label}
144 return
145 }
146 return ids[0], nil
147}
148
149// FirstIDX is like FirstID, but panics if an error occurs.
150func (_q *UserQuery) FirstIDX(ctx context.Context) uuid.UUID {

Callers 2

FirstIDXMethod · 0.95
ExistMethod · 0.95

Calls 3

LimitMethod · 0.95
setContextOpFunction · 0.85
IDsMethod · 0.45

Tested by

no test coverage detected