mongodb

package
v0.0.0-...-fba6164 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthorRepository

func NewAuthorRepository(collection *mongo.Collection) authors.Repository

func NewBookRepository

func NewBookRepository(collection *mongo.Collection) book.Repository

func NewGenreRepository

func NewGenreRepository(collection *mongo.Collection) genre.Repository

func NewSeriesRepository

func NewSeriesRepository(collection *mongo.Collection) series.Repository

Types

type AuthorRepository

type AuthorRepository struct {
	// contains filtered or unexported fields
}

func (*AuthorRepository) Create

func (r *AuthorRepository) Create(ctx context.Context, author *models.Author) error

func (*AuthorRepository) Delete

func (r *AuthorRepository) Delete(ctx context.Context, id string) error

func (*AuthorRepository) GetAll

func (r *AuthorRepository) GetAll(ctx context.Context) ([]models.Author, error)

func (*AuthorRepository) GetByID

func (r *AuthorRepository) GetByID(ctx context.Context, id string) (*models.Author, error)

func (*AuthorRepository) GetByName

func (r *AuthorRepository) GetByName(ctx context.Context, name string) (*models.Author, error)

func (*AuthorRepository) Update

func (r *AuthorRepository) Update(ctx context.Context, author *models.Author) error

type BookRepository

type BookRepository struct {
	// contains filtered or unexported fields
}

func (*BookRepository) Create

func (r *BookRepository) Create(ctx context.Context, book *models.Book) error

func (*BookRepository) Delete

func (r *BookRepository) Delete(ctx context.Context, id string) error

func (*BookRepository) GetAll

func (r *BookRepository) GetAll(ctx context.Context) ([]models.Book, error)

func (*BookRepository) GetByID

func (r *BookRepository) GetByID(ctx context.Context, id string) (*models.Book, error)

func (*BookRepository) Update

func (r *BookRepository) Update(ctx context.Context, book *models.Book) error

type GenreRepository

type GenreRepository struct {
	// contains filtered or unexported fields
}

func (*GenreRepository) Create

func (r *GenreRepository) Create(ctx context.Context, genre *models.Genre) error

func (*GenreRepository) Delete

func (r *GenreRepository) Delete(ctx context.Context, id string) error

func (*GenreRepository) GetAll

func (r *GenreRepository) GetAll(ctx context.Context) ([]models.Genre, error)

func (*GenreRepository) GetByID

func (r *GenreRepository) GetByID(ctx context.Context, id string) (*models.Genre, error)

func (*GenreRepository) GetByName

func (r *GenreRepository) GetByName(ctx context.Context, name string) (*models.Genre, error)

func (*GenreRepository) Update

func (r *GenreRepository) Update(ctx context.Context, genre *models.Genre) error

type MongoStorage

type MongoStorage struct {
	Client *mongo.Client
}

func NewMongoStorage

func NewMongoStorage() (*MongoStorage, error)

type SeriesRepository

type SeriesRepository struct {
	// contains filtered or unexported fields
}

func (*SeriesRepository) Create

func (r *SeriesRepository) Create(ctx context.Context, series *models.Series) error

func (*SeriesRepository) Delete

func (r *SeriesRepository) Delete(ctx context.Context, id string) error

func (*SeriesRepository) GetAll

func (r *SeriesRepository) GetAll(ctx context.Context) ([]models.Series, error)

func (*SeriesRepository) GetByID

func (r *SeriesRepository) GetByID(ctx context.Context, id string) (*models.Series, error)

func (*SeriesRepository) GetByName

func (r *SeriesRepository) GetByName(ctx context.Context, name string) (*models.Series, error)

func (*SeriesRepository) Update

func (r *SeriesRepository) Update(ctx context.Context, series *models.Series) error

Jump to

Keyboard shortcuts

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