book_infrastructure_repository

package
v0.0.0-...-67f085a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MongoBookCollection = "books"

Variables

This section is empty.

Functions

func NewMongoBookRepository

func NewMongoBookRepository(client *mongo.Client, logger echo.Logger) book_repository.BookRepository

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 (r *MongoBookRepository) DeleteBook(ctx context.Context, id uuid.UUID) error

func (*MongoBookRepository) GetBook

func (r *MongoBookRepository) GetBook(ctx context.Context, id uuid.UUID) (book_model.Book, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL