Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { AddStudent(student *entities.Student) (*entities.Student, error) AuthenticateStudent(email, password string) (*entities.Student, error) GetStudentByEmail(email string) (*entities.Student, error) UpdateStudentPassword(studentID, hashedPassword string) error BorrowBook(bookID, studentID string) (string, error) DeliverBook(borrowID, bookID, studentID string) (string, error) ExtendDate(borrowID string) (string, error) GetBorrowedBooks(studentID string) ([]entities.BorrowedBook, error) }
TODO add mail notifications && cron jobs
func NewRepo ¶
func NewRepo(db *pgx.Conn) Repository
type Service ¶
type Service interface { InsertStudent(student *entities.Student) (*entities.Student, error) SignIn(email, password string) (string, *entities.Student, error) RequestPasswordReset(email string) error ResetPassword(token, newPassword string) error BookBorrow(bookID, studentID string) (string, error) DeliverBook(borrowID, bookID, studentID string) (string, error) ExtendDate(borrowID string) (string, error) GetBorrowedBooks(studentID string) ([]*entities.BorrowedBook, error) }
func NewService ¶
func NewService(r Repository) Service
Click to show internal directories.
Click to hide internal directories.