Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { TransactionCreator TransactionCreator TransactionLister TransactionLister }
API holds all use cases.
func NewAPI ¶
func NewAPI(creator TransactionCreator, lister TransactionLister) *API
NewAPI initialize the API.
func (*API) HandleCreateTransaction ¶
func (api *API) HandleCreateTransaction() http.HandlerFunc
HandleCreateTransaction receives the request and call the use case to create a transaction.
func (*API) HandleListTransaction ¶
func (api *API) HandleListTransaction() http.HandlerFunc
HandleListTransaction receives the request and call the use case to list transactions.
type TransactionCreator ¶
type TransactionCreator interface {
Create(core.Transaction) (core.Transaction, error)
}
TransactionCreator represents a use case able to create a transaction.
type TransactionLister ¶
type TransactionLister interface {
List() ([]core.Transaction, error)
}
TransactionLister represents a use case able to list transactions.
Click to show internal directories.
Click to hide internal directories.