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

Method FindByEmail

app/controlplane/pkg/data/user.go:48–62  ·  view source on GitHub ↗
(ctx context.Context, email string)

Source from the content-addressed store, hash-verified

46}
47
48func (r *userRepo) FindByEmail(ctx context.Context, email string) (*biz.User, error) {
49 ctx, span := otelx.Start(ctx, userRepoTracer, "UserRepo.FindByEmail")
50 defer span.End()
51
52 u, err := r.data.DB.User.Query().
53 Where(user.Email(email)).
54 Only(ctx)
55 if err != nil && !ent.IsNotFound(err) {
56 return nil, err
57 } else if u == nil {
58 return nil, nil
59 }
60
61 return entUserToBizUser(u), nil
62}
63
64func (r *userRepo) CreateByEmail(ctx context.Context, email string, firstName, lastName *string) (*biz.User, error) {
65 ctx, span := otelx.Start(ctx, userRepoTracer, "UserRepo.CreateByEmail")

Callers

nothing calls this directly

Calls 7

StartFunction · 0.92
EmailFunction · 0.92
IsNotFoundFunction · 0.92
entUserToBizUserFunction · 0.85
OnlyMethod · 0.45
WhereMethod · 0.45
QueryMethod · 0.45

Tested by

no test coverage detected