Documentation
¶
Index ¶
- Variables
- type UserRepository
- func (self *UserRepository) Authenticate(ctx context.Context, email, password string) (*ent.User, error)
- func (self *UserRepository) GetByEmail(ctx context.Context, email string) (*ent.User, error)
- func (self *UserRepository) GetByID(ctx context.Context, id uuid.UUID) (*ent.User, error)
- func (self *UserRepository) GetGroups(ctx context.Context, userID uuid.UUID) ([]*ent.Group, error)
- func (self *UserRepository) GetOrCreate(ctx context.Context, email string) (*ent.User, error)
- type UserRepositoryInterface
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository handles user database operations
func NewUserRepository ¶
func NewUserRepository(db *ent.Client) *UserRepository
NewUserRepository creates a new repository
func (*UserRepository) Authenticate ¶
func (self *UserRepository) Authenticate(ctx context.Context, email, password string) (*ent.User, error)
Authenticate verifies a user's credentials and returns the user if successful
func (*UserRepository) GetByEmail ¶
func (*UserRepository) GetOrCreate ¶
type UserRepositoryInterface ¶
type UserRepositoryInterface interface {
GetByID(ctx context.Context, id uuid.UUID) (*ent.User, error)
GetOrCreate(ctx context.Context, email string) (*ent.User, error)
GetByEmail(ctx context.Context, email string) (*ent.User, error)
// Authenticate verifies a user's credentials and returns the user if successful
Authenticate(ctx context.Context, email, password string) (*ent.User, error)
GetGroups(ctx context.Context, userID uuid.UUID) ([]*ent.Group, error)
}
UserRepositoryInterface ...
Click to show internal directories.
Click to hide internal directories.