Documentation
¶
Index ¶
- type BookSvc
- type BookSvcImpl
- func (b *BookSvcImpl) Create(ctx context.Context, book *repository.Book) (int64, error)
- func (b *BookSvcImpl) Delete(ctx context.Context, paramID string) error
- func (b *BookSvcImpl) Patch(ctx context.Context, paramID string, book *repository.Book) error
- func (b *BookSvcImpl) Retrieve(ctx context.Context) ([]*repository.Book, error)
- func (b *BookSvcImpl) RetrieveOne(ctx context.Context, paramID string) (*repository.Book, error)
- func (b *BookSvcImpl) Update(ctx context.Context, paramID string, book *repository.Book) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookSvc ¶
type BookSvc interface {
RetrieveOne(context.Context, string) (*repository.Book, error)
Retrieve(context.Context) ([]*repository.Book, error)
Create(context.Context, *repository.Book) (int64, error)
Delete(context.Context, string) error
Update(context.Context, string, *repository.Book) error
Patch(context.Context, string, *repository.Book) error
}
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
repository.BookRepo
}
BookSvcImpl is implementation of BookSvc
func (*BookSvcImpl) Create ¶
func (b *BookSvcImpl) Create(ctx context.Context, book *repository.Book) (int64, error)
Create Book
func (*BookSvcImpl) Delete ¶
func (b *BookSvcImpl) Delete(ctx context.Context, paramID string) error
Delete book
func (*BookSvcImpl) Patch ¶
func (b *BookSvcImpl) Patch(ctx context.Context, paramID string, book *repository.Book) error
Patch book
func (*BookSvcImpl) Retrieve ¶ added in v0.8.32
func (b *BookSvcImpl) Retrieve(ctx context.Context) ([]*repository.Book, error)
Retrieve books
func (*BookSvcImpl) RetrieveOne ¶ added in v0.8.32
func (b *BookSvcImpl) RetrieveOne(ctx context.Context, paramID string) (*repository.Book, error)
RetrieveOne book
func (*BookSvcImpl) Update ¶
func (b *BookSvcImpl) Update(ctx context.Context, paramID string, book *repository.Book) error
Update book
Click to show internal directories.
Click to hide internal directories.