Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID string `json:"id"` CreatedAt time.Time `json:"createdAt"` Description string `json:"description"` Balance int64 `json:"balance"` Currency string `json:"currency"` LastUpdatedAt time.Time `json:"lastUpdatedAt"` }
Account describes single user's bank account.
type BankAPI ¶
type BankAPI interface { // GetUserInfo loads user accounts list. GetUserInfo(ctx context.Context) ([]mono.Account, error) }
BankAPI abstracts bank API related to accounts information.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles /vN/account* and /vN/accounts* routes.
func NewHandler ¶
func NewHandler(storage *Repository) *Handler
NewHandler returns new instance of Handler.
func (*Handler) BindRoutes ¶
BindRoutes bind gin routes to handler methods.
func (*Handler) GetAccounts ¶
GetAccounts returns accounts list.
type Importer ¶
type Importer struct {
// contains filtered or unexported fields
}
Importer loads the latest account related data from bank for specified accountID and saves it to storage.
func NewImporter ¶
NewImporter create new instance of Importer.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository implements persistent storage layer for accounts in PostgreSQL.
func NewRepository ¶
func NewRepository(pool *pgxpool.Pool) *Repository
NewRepository creates new instance of Repository.
Click to show internal directories.
Click to hide internal directories.