application

package
v0.0.0-...-0a0b1f3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 4 Imported by: 0

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

func (BookStockService) Get

Get selects the bookStock from the included repository with the given unique identifier, and returns it Returns an error if the repository returns one

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

Jump to

Keyboard shortcuts

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