Documentation
¶
Index ¶
- Constants
- func NewMongoBookRepository(client *mongo.Client, logger echo.Logger) book_repository.BookRepository
- type BookDocument
- type BookDocuments
- type MongoBookRepository
- func (r *MongoBookRepository) DeleteBook(ctx context.Context, id uuid.UUID) error
- func (r *MongoBookRepository) GetBook(ctx context.Context, id uuid.UUID) (book_model.Book, error)
- func (r *MongoBookRepository) SaveBook(ctx context.Context, book book_model.Book) (book_model.Book, error)
- func (r *MongoBookRepository) SearchBooks(ctx context.Context) (book_model.Books, error)
Constants ¶
View Source
const MongoBookCollection = "books"
Variables ¶
This section is empty.
Functions ¶
func NewMongoBookRepository ¶
Types ¶
type BookDocument ¶
type BookDocument struct { ID string `bson:"_id"` Title string `bson:"title"` ISBN string `bson:"isbn"` Cover image_infrastructure_repository.ImageDocument `bson:"cover"` Thumbnail image_infrastructure_repository.ImageDocument `bson:"thumbnail"` DisplayImages image_infrastructure_repository.ImageDocuments `bson:"display_images"` }
func NewBookDocument ¶
func NewBookDocument(book book_model.Book) *BookDocument
func (*BookDocument) ToEntity ¶
func (doc *BookDocument) ToEntity() book_model.Book
type BookDocuments ¶
type BookDocuments []BookDocument
func (BookDocuments) ToEntites ¶
func (docs BookDocuments) ToEntites() book_model.Books
type MongoBookRepository ¶
type MongoBookRepository struct {
// contains filtered or unexported fields
}
func (*MongoBookRepository) DeleteBook ¶
func (*MongoBookRepository) SaveBook ¶
func (r *MongoBookRepository) SaveBook(ctx context.Context, book book_model.Book) (book_model.Book, error)
func (*MongoBookRepository) SearchBooks ¶
func (r *MongoBookRepository) SearchBooks(ctx context.Context) (book_model.Books, error)
Click to show internal directories.
Click to hide internal directories.