services

package
v0.0.0-...-5f2b7d0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookService

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

BookService defines a book service

func NewBookService

func NewBookService(gi goisbn.Queryer) *BookService

NewBookService creates a new instance of BookService

func (*BookService) Get

func (svc *BookService) Get(ctx context.Context, isbn string) (*entities.Book, error)

Get returns details of a book from providers

type DBService

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

DBService defines dbService

func NewDbService

func NewDbService(r repo.IdbRepo) *DBService

NewDbService creates a new instance of DBService

func (*DBService) Get

func (svc *DBService) Get(ctx context.Context, isbn string, userId string) (*entities.Book, error)

Get gets the database record matching search criteria

func (*DBService) List

func (svc *DBService) List(ctx context.Context, limit, offset int64, userId string) ([]*entities.Book, error)

List lists all database records matching search criteria

func (*DBService) Upsert

func (svc *DBService) Upsert(ctx context.Context, isbn, title, authors, imageURL, smallImageURL, publisher, userId, description, categories, language, source string, publicationYear, status, pageCount int64) (*entities.Book, error)

Upsert updates the database record if a record is found, creates a record if none is found

type Ibooks

type Ibooks interface {
	Get(context.Context, string) (*entities.Book, error)
}

Ibooks defines the interface for bookService

type IdbService

IdbService defines the interface for dbService

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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