service

package
v0.9.10 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2020 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 BookSvc

BookSvc contain logic for Book Controller @mock

func NewBookSvc

func NewBookSvc(impl BookSvcImpl) BookSvc

NewBookSvc return new instance of BookSvc @ctor

type BookSvcImpl

type BookSvcImpl struct {
	dig.In
	Repo postgresdb_repo.BookRepo
}

BookSvcImpl is implementation of BookSvc

func (*BookSvcImpl) Create

func (b *BookSvcImpl) Create(ctx context.Context, book *postgresdb.Book) (*postgresdb.Book, error)

Create Book

func (*BookSvcImpl) Delete

func (b *BookSvcImpl) Delete(ctx context.Context, paramID string) error

Delete book

func (*BookSvcImpl) Find

func (b *BookSvcImpl) Find(ctx context.Context, req *FindBookReq) (*FindBookResp, error)

Find books

func (*BookSvcImpl) FindOne

func (b *BookSvcImpl) FindOne(ctx context.Context, paramID string) (*postgresdb.Book, error)

FindOne book

func (*BookSvcImpl) Patch

func (b *BookSvcImpl) Patch(ctx context.Context, paramID string, book *postgresdb.Book) (*postgresdb.Book, error)

Patch book

func (*BookSvcImpl) Update

func (b *BookSvcImpl) Update(ctx context.Context, paramID string, book *postgresdb.Book) (*postgresdb.Book, error)

Update book

type FindBookReq added in v0.9.9

type FindBookReq struct {
	Limit  uint64 `query:"limit"`
	Offset uint64 `query:"offset"`
	Sort   string `query:"sort"`
}

FindBookReq find request

type FindBookResp added in v0.9.9

type FindBookResp struct {
	Books      []*postgresdb.Book
	TotalCount string
}

FindBookResp find book resp

Jump to

Keyboard shortcuts

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