Versions in this module Expand all Collapse all v1 v1.0.0 Aug 6, 2023 Changes in this version + func NewPostgres(host, port, username, password, dbname, sslmode string) (*sql.DB, error) + type Auth interface + CreateUser func(user entities.User) (int, error) + GetUserId func(username, password_hash string) (int, error) + type AuthRepository struct + func NewAuthRepository(db *sql.DB) *AuthRepository + func (r *AuthRepository) CreateUser(user entities.User) (int, error) + func (r *AuthRepository) GetUserId(username, password_hash string) (int, error) + type Book interface + CreateBook func(book entities.Book) (int, error) + DeleteBook func(id int) error + GetBook func(id int) (*entities.Book, error) + GetBooks func() ([]*entities.Book, error) + UpdateBook func(book entities.Book) error + type BookRepository struct + func NewBookRepository(db *sql.DB) *BookRepository + func (r *BookRepository) CreateBook(book entities.Book) (int, error) + func (r *BookRepository) DeleteBook(id int) error + func (r *BookRepository) GetBook(id int) (*entities.Book, error) + func (r *BookRepository) GetBooks() ([]*entities.Book, error) + func (r *BookRepository) UpdateBook(book entities.Book) error + type Repository struct + func NewRepository(db *sql.DB) *Repository