Added password token entity.

This commit is contained in:
mikestefanello 2021-12-15 08:48:51 -05:00
parent 1ac68b7d9f
commit c9d50cb3d4
25 changed files with 3489 additions and 20 deletions

View file

@ -8,6 +8,19 @@ import (
"goweb/ent"
)
// The PasswordTokenFunc type is an adapter to allow the use of ordinary
// function as PasswordToken mutator.
type PasswordTokenFunc func(context.Context, *ent.PasswordTokenMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f PasswordTokenFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
mv, ok := m.(*ent.PasswordTokenMutation)
if !ok {
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.PasswordTokenMutation", m)
}
return f(ctx, mv)
}
// The UserFunc type is an adapter to allow the use of ordinary
// function as User mutator.
type UserFunc func(context.Context, *ent.UserMutation) (ent.Value, error)