Documentation ¶
Overview ¶
Package application contains the application logic of the bookInfo management system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookInfoRepository ¶
type BookInfoRepository interface { List(ctx context.Context) ([]domain.BookInfo, error) Get(ctx context.Context, ISBN string) (domain.BookInfo, error) }
BookInfoRepository is the interface that we expect to be fulfilled to be used as a backend for BookInfo Service
type BookInfoService ¶
type BookInfoService struct {
// contains filtered or unexported fields
}
BookInfoService represents the struct which contains a BookInfoRepository and exports methods to access the data
func NewBookInfoService ¶
func NewBookInfoService(dr BookInfoRepository) BookInfoService
NewBookInfoService creates a new BookInfoService instance and sets its repository
type ErrorCannotFindBook ¶
type ErrorCannotFindBook struct { }
ErrorCannotFindBook is used when the Book with the given ISBN cannot be found on the underlying data source
func (*ErrorCannotFindBook) Error ¶
func (e *ErrorCannotFindBook) Error() string
type ErrorCannotFindBooks ¶
type ErrorCannotFindBooks struct{}
ErrorCannotFindBooks is used when no Book data cannot be retrieved on the underlying data source
func (*ErrorCannotFindBooks) Error ¶
func (e *ErrorCannotFindBooks) Error() string
type ErrorParsePayload ¶
type ErrorParsePayload struct{}
ErrorParsePayload is used when the payload is cannot be parsed by the communications package
func (*ErrorParsePayload) Error ¶
func (e *ErrorParsePayload) Error() string
type ErrorPayloadMissing ¶
type ErrorPayloadMissing struct{}
ErrorPayloadMissing is used when the communication package expects a payload and there is none
func (*ErrorPayloadMissing) Error ¶
func (e *ErrorPayloadMissing) Error() string
type ErrorReadPayload ¶
type ErrorReadPayload struct{}
ErrorReadPayload is used when the payload is cannot be read by the communications package
func (*ErrorReadPayload) Error ¶
func (e *ErrorReadPayload) Error() string
type HealthRepository ¶
type HealthRepository interface {
Ready() bool
}
HealthRepository is the interface to interact with database
type HealthService ¶
type HealthService struct {
HealthRepository HealthRepository
}
HealthService is the struct to let outer layers to interact to the health applicatopn
func NewHealthService ¶
func NewHealthService(hr HealthRepository) HealthService
NewHealthService creates a new HealthService instance and sets its repository
func (HealthService) Ready ¶
func (hs HealthService) Ready() bool
Ready returns true if underlying reposiroty and its connection is up and running, false otherwise