Documentation ¶
Overview ¶
library/routes.go
Index ¶
- type BookHandler
- type BookStore
- func (s *BookStore) AddToFavorites(userID, bookID string) error
- func (s *BookStore) CreateBook(book types.CreateBookPayload) error
- func (s *BookStore) DeleteBook(bookID string) error
- func (s *BookStore) DeleteReview(reviewID string) error
- func (s *BookStore) DeleteUserReview(userID, reviewID string) error
- func (s *BookStore) GetAllBooks() ([]*types.Book, error)
- func (s *BookStore) GetBookByID(bookID string) (*types.Book, error)
- func (s *BookStore) GetReviews(bookID string) ([]types.Review, error)
- func (s *BookStore) PostReview(userID, bookID string, review types.ReviewPayload) error
- func (s *BookStore) SearchBooks(searchTerm string) ([]types.Book, error)
- func (s *BookStore) UpdateBook(bookID string, book types.UpdateBookPayload) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookHandler ¶
type BookHandler struct {
// contains filtered or unexported fields
}
func NewBookHandler ¶
func NewBookHandler(bookStore types.BookStore, userStore types.UserStore) *BookHandler
func (*BookHandler) RegisterRoutes ¶
func (h *BookHandler) RegisterRoutes(router *mux.Router)
type BookStore ¶
type BookStore struct {
// contains filtered or unexported fields
}
func (*BookStore) AddToFavorites ¶
Add a book to user's favorites list
func (*BookStore) CreateBook ¶
func (s *BookStore) CreateBook(book types.CreateBookPayload) error
func (*BookStore) DeleteBook ¶
func (*BookStore) DeleteReview ¶
Admin deletes a review
func (*BookStore) DeleteUserReview ¶
Delete a user review
func (*BookStore) GetReviews ¶
Get reviews for a book
func (*BookStore) PostReview ¶
func (s *BookStore) PostReview(userID, bookID string, review types.ReviewPayload) error
Post a review for a book
func (*BookStore) SearchBooks ¶
func (*BookStore) UpdateBook ¶
func (s *BookStore) UpdateBook(bookID string, book types.UpdateBookPayload) error
Click to show internal directories.
Click to hide internal directories.