user.go 608 B

123456789101112131415161718
  1. package repository
  2. import (
  3. "github.com/porter-dev/porter/internal/models"
  4. )
  5. // WriteUser is the function type for all User write operations
  6. type WriteUser func(user *models.User) (*models.User, error)
  7. // UserRepository represents the set of queries on the User model
  8. type UserRepository interface {
  9. CreateUser(user *models.User) (*models.User, error)
  10. CheckPassword(id int, pwd string) (bool, error)
  11. ReadUser(id uint) (*models.User, error)
  12. ReadUserByEmail(email string) (*models.User, error)
  13. UpdateUser(user *models.User) (*models.User, error)
  14. DeleteUser(user *models.User) (*models.User, error)
  15. }