MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / FindByID

Method FindByID

app/controlplane/pkg/data/user.go:91–103  ·  view source on GitHub ↗

Find by ID, returns nil if not found

(ctx context.Context, userID uuid.UUID)

Source from the content-addressed store, hash-verified

89
90// Find by ID, returns nil if not found
91func (r *userRepo) FindByID(ctx context.Context, userID uuid.UUID) (*biz.User, error) {
92 ctx, span := otelx.Start(ctx, userRepoTracer, "UserRepo.FindByID")
93 defer span.End()
94
95 u, err := r.data.DB.User.Get(ctx, userID)
96 if err != nil && !ent.IsNotFound(err) {
97 return nil, err
98 } else if u == nil {
99 return nil, nil
100 }
101
102 return entUserToBizUser(u), nil
103}
104
105func (r *userRepo) Delete(ctx context.Context, userID uuid.UUID) (err error) {
106 ctx, span := otelx.Start(ctx, userRepoTracer, "UserRepo.Delete")

Callers 1

CreateByEmailMethod · 0.95

Calls 4

StartFunction · 0.92
IsNotFoundFunction · 0.92
entUserToBizUserFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected