This commit is contained in:
lbenedar
2026-03-06 11:48:48 +03:00
parent 6eee11400c
commit 91f5a63366
3 changed files with 37 additions and 1 deletions

View File

@@ -2,4 +2,8 @@ package models
import "errors"
var ErrNoRecord = errors.New("models: no matching record found")
var (
ErrNoRecord = errors.New("models: no matching record found")
ErrInvalidCredentials = errors.New("models: invalid credentials")
ErrDuplicateEmail = errors.New("models: duplicate email")
)

30
internal/models/users.go Normal file
View File

@@ -0,0 +1,30 @@
package models
import (
"database/sql"
"time"
)
type User struct {
ID int
Name string
Email string
HashedPassword []byte
Created time.Time
}
type UserModel struct {
DB *sql.DB
}
func (m *UserModel) Insert(name, email, password string) error {
return nil
}
func (m *UserModel) Authenticate(email, password string) (int, error) {
return 0, nil
}
func (m *UserModel) Exists(id int) (bool, error) {
return false, nil
}