Documentation ¶
Index ¶
- func NewPostgres(host, port, username, password, dbname, sslmode string) (*sql.DB, error)
- type Auth
- type AuthRepository
- type Book
- type 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthRepository ¶
type AuthRepository struct {
// contains filtered or unexported fields
}
func NewAuthRepository ¶
func NewAuthRepository(db *sql.DB) *AuthRepository
func (*AuthRepository) CreateUser ¶
func (r *AuthRepository) CreateUser(user entities.User) (int, error)
type BookRepository ¶
type BookRepository struct {
// contains filtered or unexported fields
}
func NewBookRepository ¶
func NewBookRepository(db *sql.DB) *BookRepository
func (*BookRepository) CreateBook ¶
func (r *BookRepository) CreateBook(book entities.Book) (int, error)
func (*BookRepository) DeleteBook ¶
func (r *BookRepository) DeleteBook(id int) error
func (*BookRepository) UpdateBook ¶
func (r *BookRepository) UpdateBook(book entities.Book) error
type Repository ¶
func NewRepository ¶
func NewRepository(db *sql.DB) *Repository
Click to show internal directories.
Click to hide internal directories.