feat: improvements in structures
This commit is contained in:
@@ -4,6 +4,26 @@ import (
|
||||
"github.com/eminetto/clean-architecture-go-v2/domain/entity"
|
||||
)
|
||||
|
||||
//Reader interface
|
||||
type Reader interface {
|
||||
Get(id entity.ID) (*entity.Book, error)
|
||||
Search(query string) ([]*entity.Book, error)
|
||||
List() ([]*entity.Book, error)
|
||||
}
|
||||
|
||||
//Writer book writer
|
||||
type Writer interface {
|
||||
Create(e *entity.Book) (entity.ID, error)
|
||||
Update(e *entity.Book) error
|
||||
Delete(id entity.ID) error
|
||||
}
|
||||
|
||||
//Repository interface
|
||||
type Repository interface {
|
||||
Reader
|
||||
Writer
|
||||
}
|
||||
|
||||
//UseCase interface
|
||||
type UseCase interface {
|
||||
GetBook(id entity.ID) (*entity.Book, error)
|
||||
|
||||
Reference in New Issue
Block a user