Documentation ¶
Index ¶
- Variables
- type API
- type App
- type Config
- type Repository
- func (r *Repository) CreateAccount(account *models.Account) error
- func (r *Repository) CreateCard(card *models.Card) error
- func (r *Repository) CreateTransaction(transaction *models.Transaction) error
- func (r *Repository) FindCardForAuthorization(card models.Card) (*models.Card, error)
- func (r *Repository) GetAccount(accountID string) (*models.Account, error)
- func (r *Repository) ListTransactions(accountID string) ([]*models.Transaction, error)
- type Service
- func (i *Service) AuthorizeRequest(req models.AuthorizationRequest) (models.AuthorizationResponse, error)
- func (i *Service) CreateAccount(req models.CreateAccount) (*models.Account, error)
- func (i *Service) GetAccount(accountID string) (*models.Account, error)
- func (i *Service) IssueCard(accountID string) (*models.Card, error)
- func (i *Service) ListTransactions(accountID string) ([]*models.Transaction, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = fmt.Errorf("not found")
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is a HTTP API for the issuer service
func (*API) AppendRoutes ¶
func (a *API) AppendRoutes(r chi.Router)
type App ¶
App is the main application, it contains all the components of the issuer service and is responsible for starting and stopping them.
type Config ¶
Config is a configuration for the issuer application
func DefaultConfig ¶
func DefaultConfig() *Config
type Repository ¶
type Repository struct { Cards []*models.Card Accounts []*models.Account Transactions []*models.Transaction // contains filtered or unexported fields }
func NewRepository ¶
func NewRepository() *Repository
func (*Repository) CreateAccount ¶
func (r *Repository) CreateAccount(account *models.Account) error
func (*Repository) CreateCard ¶
func (r *Repository) CreateCard(card *models.Card) error
func (*Repository) CreateTransaction ¶
func (r *Repository) CreateTransaction(transaction *models.Transaction) error
func (*Repository) FindCardForAuthorization ¶
func (*Repository) GetAccount ¶
func (r *Repository) GetAccount(accountID string) (*models.Account, error)
func (*Repository) ListTransactions ¶
func (r *Repository) ListTransactions(accountID string) ([]*models.Transaction, error)
ListTransactions returns all transactions for a given account ID.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo *Repository) *Service
func (*Service) AuthorizeRequest ¶
func (i *Service) AuthorizeRequest(req models.AuthorizationRequest) (models.AuthorizationResponse, error)
func (*Service) CreateAccount ¶
func (*Service) GetAccount ¶
func (*Service) ListTransactions ¶
func (i *Service) ListTransactions(accountID string) ([]*models.Transaction, error)
ListTransactions returns a list of transactions for the given account ID.
Click to show internal directories.
Click to hide internal directories.