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

Method Fields

app/controlplane/pkg/data/ent/schema/user.go:37–61  ·  view source on GitHub ↗

Fields of the User.

()

Source from the content-addressed store, hash-verified

35
36// Fields of the User.
37func (User) Fields() []ent.Field {
38 return []ent.Field{
39 field.String("email").
40 Unique().
41 Validate(func(email string) error {
42 _, err := mail.ParseAddress(email)
43 return err
44 }),
45 field.UUID("id", uuid.UUID{}).Default(uuid.New).Unique(),
46 field.Time("created_at").
47 Default(time.Now).
48 Immutable().
49 Annotations(&entsql.Annotation{
50 Default: "CURRENT_TIMESTAMP",
51 }),
52 field.Time("updated_at").
53 Default(time.Now).
54 Annotations(&entsql.Annotation{
55 Default: "CURRENT_TIMESTAMP",
56 }),
57 field.Bool("has_restricted_access").Optional().Nillable(),
58 field.String("first_name").Optional(),
59 field.String("last_name").Optional(),
60 }
61}
62
63// Edges of the User.
64func (User) Edges() []ent.Edge {

Callers 3

normalizeKeyFunction · 0.45
initFunction · 0.45
IndexesMethod · 0.45

Calls 6

DefaultMethod · 0.80
AnnotationsMethod · 0.80
BoolMethod · 0.80
StringMethod · 0.65
ValidateMethod · 0.45
UniqueMethod · 0.45

Tested by

no test coverage detected