Documentation
¶
Overview ¶
Package application contains the application logic of the bookStock management system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookStockRepository ¶
type BookStockRepository interface {
Get(ctx context.Context, ISBN string) (domain.BookStock, error)
}
BookStockRepository is the interface that we expect to be fulfilled to be used as a backend for BookStock Service
type BookStockService ¶
type BookStockService struct {
// contains filtered or unexported fields
}
BookStockService represents the struct which contains a BookStockRepository and exports methods to access the data
func NewBookStockService ¶
func NewBookStockService(br BookStockRepository) BookStockService
NewBookStockService creates a new BookStockService instance and sets its repository
type ErrorCannotFindBookStock ¶
type ErrorCannotFindBookStock struct {
ISBN string
}
ErrorCannotFindBookStock is used when no Book stock data cannot be retrieved on the underlying data source
func (*ErrorCannotFindBookStock) Error ¶
func (e *ErrorCannotFindBookStock) 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