persistance

package
v0.0.0-...-e3d7e6a Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLibraryDb

func NewLibraryDb(connectionString string) (*libraryDb, error)

Types

type LibraryDb

type LibraryDb interface {
	CreateAuthor(ctx context.Context, data model2.Author) (model2.Author, error)
	UpdateAuthor(ctx context.Context, data model2.Author) error
	DeleteAuthor(ctx context.Context, Id uint) error
	GetAllAuthors(ctx context.Context) ([]*model2.Author, error)
	GetAuthorById(ctx context.Context, Id uint) (*model2.Author, error)

	CreateGenre(ctx context.Context, data model2.Genre) (model2.Genre, error)
	UpdateGenre(ctx context.Context, data model2.Genre) error
	DeleteGenre(ctx context.Context, Id uint) error
	GetAllGenres(ctx context.Context) ([]*model2.Genre, error)
	GetGenresById(ctx context.Context, Id uint) (*model2.Genre, error)

	CreateBook(ctx context.Context, data model2.Book) (model2.Book, error)
	UpdateBook(ctx context.Context, data model2.Book) error
	DeleteBook(ctx context.Context, Id uint) error
	GetAllBooks(ctx context.Context) ([]*model2.Book, error)
	GetBookById(ctx context.Context, Id uint) (*model2.Book, error)

	CreateSubscriber(ctx context.Context, data model2.Subscriber) (model2.Subscriber, error)
	UpdateSubscriber(ctx context.Context, data model2.Subscriber) error
	DeleteSubscriber(ctx context.Context, Id uint) error
	GetAllSubscribers(ctx context.Context) ([]*model2.Subscriber, error)
	GetSubscriberById(ctx context.Context, Id uint) (*model2.Subscriber, error)

	Subscribe(ctx context.Context, subscriberID uint, listOfBooks []model2.Book, listOfAuthors []model2.Author) (*model2.Subscribe, error)
	DeleteSubscribe(ctx context.Context, Id uint) error
	GetAllSubscribes(ctx context.Context) ([]*model2.Subscribe, error)
	GetSubscribeById(ctx context.Context, Id uint) (*model2.Subscribe, error)
	GetAuthorsSubscribers(ctx context.Context, listOfAuthors []model2.Author) ([]*model2.Subscriber, error)
}

Jump to

Keyboard shortcuts

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