repository

package
v0.0.0-...-68e8b16 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotFound = errors.New("user not found")  // ErrUserNotFound is returned when a user is not found in the database.
	ErrInvalidId    = errors.New("invalid user id") // ErrUserNotFound is returned when a user id is invalid or malformed.
	ErrRepoConnErr  = errors.New("repository connection lost")
)

Functions

This section is empty.

Types

type UserRepository

type UserRepository interface {
	CreateUser(user *models.UserModel) error
	GetUserByID(id string) (*models.UserModel, error)
	UpdateUser(user *models.UserModel) error
	DeleteUser(id string) error
	GetUserByEmail(email string) (*models.UserModel, error)
	InsertUser(user *models.UserModel) error
}

UserRepository represents the interface for user-related database operations.

func NewSQLUserRepository

func NewSQLUserRepository(database *sql.DB) UserRepository

NewSQLUserRepository creates and returns a new sql flavoured UserRepository instance.

Jump to

Keyboard shortcuts

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