banklab

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package banklab is BankLab, a retail bank's API: customers with current and savings accounts, transaction history, monthly statements, transfers and bill payments that take an Idempotency-Key, and a reconciliation check. It is the reference app for the fintech pack. Bill payments go to the bank's own biller accounts: nothing leaves the app, and no payment provider is involved.

Planted bottlenecks (see README.md), each switched off by a fix flag:

  • lock: every transfer and payment holds one ledger-wide lock, fraud check included, so money moves one transfer at a time and balance reads queue behind it (fix "lock" runs the fraud check first and locks only the two accounts involved).
  • balance: an account's balance is the sum of all its postings, recomputed for every balance read and every transfer, so it slows down as history grows (fix "balance" keeps a running balance).
  • statements: a monthly statement scans the whole bank's journal for the account's postings (fix "statements" reads the account's own postings, found by date).

Index

Constants

View Source
const Customers = 1000

Customers is how many customers BankLab has (c0001 ... c1000).

View Source
const Password = "banklab-pass"

Password is every customer's password.

Variables

This section is empty.

Functions

func New

func New(cfg labkit.Config) http.Handler

New returns BankLab's handler.

Types

This section is empty.

Jump to

Keyboard shortcuts

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