userstorage

package
v0.0.0-...-435fad9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUserNotFound = errors.New("user not found")

ErrUserNotFound is the error returned when a user cannot be found.

Functions

This section is empty.

Types

type UserStore

type UserStore interface {
	Create(user *modeluser.User) error
	GetUserByEmail(email string) (*modeluser.User, error)
	GetAllUsers() ([]modeluser.User, error)
	Update(user *modeluser.User) error
	Delete(id uuid.UUID) error
	GetUserByUUID(id uuid.UUID) (*modeluser.User, error)
	CheckLastLogin(id uuid.UUID) (bool, error)
	EmailVerified(email string) (bool, error)
	UpdateLastLogin(userID uuid.UUID, lastLogin *time.Time) error
	IsEmailExists(email string) bool
	IsEmailExistsForOtherUser(email string, excludeUserID uuid.UUID) bool
	Restore(id uuid.UUID) error
	UpdateOmitFields(user *modeluser.User, omitFields ...string) error
	SoftDelete(id uuid.UUID) error
	IsSoftDeleted(userID uuid.UUID) (bool, error)
}

UserStore defines the interface for user storage operations

func NewUserStore

func NewUserStore(db *gorm.DB) UserStore

NewUserStore creates a new instance of a user store

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL