Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
hardcount
command
Hardcount is the billing server.
|
Hardcount is the billing server. |
|
hardcount-bench-seed
command
hardcount-bench-seed prepares a database for an ingest benchmark and prints the credentials the load generator needs.
|
hardcount-bench-seed prepares a database for an ingest benchmark and prints the credentials the load generator needs. |
|
hardcount-bootstrap
command
hardcount-bootstrap runs the database migrations, then creates a tenant with its settings, API keys and owner login, and prints the credentials.
|
hardcount-bootstrap runs the database migrations, then creates a tenant with its settings, API keys and owner login, and prints the credentials. |
|
hardcount-docs-run
command
hardcount-docs-run runs the commands of a Markdown page, in order, in one bash shell, and checks that each prints what the page says it prints.
|
hardcount-docs-run runs the commands of a Markdown page, in order, in one bash shell, and checks that each prints what the page says it prints. |
|
hardcount-doctor
command
hardcount-doctor sweeps a Hardcount database for money-invariant violations: states that no legal writer can produce.
|
hardcount-doctor sweeps a Hardcount database for money-invariant violations: states that no legal writer can produce. |
|
internal
|
|
|
api
Package api provides the HTTP server and route wiring for Hardcount.
|
Package api provides the HTTP server and route wiring for Hardcount. |
|
api/middleware
Package middleware holds the HTTP middleware of the API server.
|
Package middleware holds the HTTP middleware of the API server. |
|
api/respond
Package respond writes the API's JSON responses: success bodies, list pages and the error envelope.
|
Package respond writes the API's JSON responses: success bodies, list pages and the error envelope. |
|
api/timefilter
Package timefilter parses the ?from and ?to query parameters, and named variants such as ?date_from and ?date_to, for the operator-facing list and export endpoints.
|
Package timefilter parses the ?from and ?to query parameters, and named variants such as ?date_from and ?date_to, for the operator-facing list and export endpoints. |
|
auth
Package auth issues API keys and decides who may do what.
|
Package auth issues API keys and decides who may do what. |
|
billing
Package billing contains the billing cycle engine, scheduler, and invoice preview.
|
Package billing contains the billing cycle engine, scheduler, and invoice preview. |
|
config
Package config reads Hardcount's settings from the environment and checks them at start-up.
|
Package config reads Hardcount's settings from the environment and checks them at start-up. |
|
dashmembers
Package dashmembers is the minimal team-membership surface: invite by email, tokenized accept, list, revoke, remove.
|
Package dashmembers is the minimal team-membership surface: invite by email, tokenized accept, list, revoke, remove. |
|
doctor
Package doctor is the money-invariant sweep: a read-only check of a Hardcount database for states that no legal writer can produce.
|
Package doctor is the money-invariant sweep: a read-only check of a Hardcount database for states that no legal writer can produce. |
|
domain
Package domain holds what Hardcount's packages share: the types and status words that cross a package boundary or the wire, and the pure rules two packages must apply the same way, as Go functions or as the SQL text of a condition.
|
Package domain holds what Hardcount's packages share: the types and status words that cross a package boundary or the wire, and the pure rules two packages must apply the same way, as Go functions or as the SQL text of a condition. |
|
errs
Package errs provides structured domain errors with machine-readable codes.
|
Package errs provides structured domain errors with machine-readable codes. |
|
hostedinvoice
Package hostedinvoice serves the public /v1/public/invoices/* surface — Stripe's hosted_invoice_url equivalent.
|
Package hostedinvoice serves the public /v1/public/invoices/* surface — Stripe's hosted_invoice_url equivalent. |
|
integrations/litellm
Package litellm adapts LiteLLM Proxy's StandardLoggingPayload to Hardcount usage events.
|
Package litellm adapts LiteLLM Proxy's StandardLoggingPayload to Hardcount usage events. |
|
payment/breaker
Package breaker provides a global circuit breaker around Stripe API calls, built on sony/gobreaker/v2.
|
Package breaker provides a global circuit breaker around Stripe API calls, built on sony/gobreaker/v2. |
|
paymentmethods
Package paymentmethods is the customer-facing view of payment methods.
|
Package paymentmethods is the customer-facing view of payment methods. |
|
pdffonts
Package pdffonts embeds the TTF fonts that Hardcount's PDF renderers use (invoice, credit note).
|
Package pdffonts embeds the TTF fonts that Hardcount's PDF renderers use (invoice, credit note). |
|
platform/activity
Package activity holds the shape of an activity line and the words that more than one activity surface shares (ADR-128).
|
Package activity holds the shape of an activity line and the words that more than one activity surface shares (ADR-128). |
|
platform/clock
Package clock gives code the current time, by one rule: a request's time is bound by the API's middleware (api.bindRequestTime), and work that outlives a request, and every job, binds one per row (EnsureEffectiveNow).
|
Package clock gives code the current time, by one rule: a request's time is bound by the API's middleware (api.bindRequestTime), and work that outlives a request, and every job, binds one per row (EnsureEffectiveNow). |
|
platform/crypto
Package crypto encrypts stored values, such as PII fields and API secrets, with AES-256-GCM.
|
Package crypto encrypts stored values, such as PII fields and API secrets, with AES-256-GCM. |
|
platform/leader
Package leader holds singleton-role leadership as a row, not as a Postgres session (ADR-114).
|
Package leader holds singleton-role leadership as a row, not as a Postgres session (ADR-114). |
|
platform/leader/leadertest
Package leadertest lets store tests call leader-only methods with a real, live lease token and no heartbeat.
|
Package leadertest lets store tests call leader-only methods with a real, live lease token and no heartbeat. |
|
platform/listorder
Package listorder is the one rule for a list's ?sort and ?dir.
|
Package listorder is the one rule for a list's ?sort and ?dir. |
|
platform/logging
Package logging holds ErrorLevel, which picks the log level for an error from work done for a request.
|
Package logging holds ErrorLevel, which picks the log level for an error from work done for a request. |
|
platform/migrate
Package migrate applies Hardcount's database migrations with goose (ADR-125).
|
Package migrate applies Hardcount's database migrations with goose (ADR-125). |
|
platform/money
Package money holds small, dependency-free helpers for integer-cents math, shared by billing, subscription proration and tax.
|
Package money holds small, dependency-free helpers for integer-cents math, shared by billing, subscription proration and tax. |
|
platform/postgres
Package postgres opens database transactions with the settings that row-level security (RLS) reads.
|
Package postgres opens database transactions with the settings that row-level security (RLS) reads. |
|
platform/request
Package request holds one HTTP request's record: what the layers of the request learn about it, readable by every layer, inner or outer.
|
Package request holds one HTTP request's record: what the layers of the request learn about it, readable by every layer, inner or outer. |
|
platform/request/requesttest
Package requesttest gives tests a request's record: request.Begin with a route that holds only the method, and no mw.TrustedClientIP in front, so the record's client address is the request's TCP peer.
|
Package requesttest gives tests a request's record: request.Begin with a route that holds only the method, and no mw.TrustedClientIP in front, so the record's client address is the request's TCP peer. |
|
platform/scheduler
Package scheduler hosts the standard tick-loop runner that every ticker-driven singleton worker in Hardcount uses.
|
Package scheduler hosts the standard tick-loop runner that every ticker-driven singleton worker in Hardcount uses. |
|
platform/telemetry
Package telemetry sets up OpenTelemetry tracing for Hardcount.
|
Package telemetry sets up OpenTelemetry tracing for Hardcount. |
|
platform/timeline
Package timeline holds the two ordering rules that every activity or timeline surface must keep:
|
Package timeline holds the two ordering rules that every activity or timeline surface must keep: |
|
platform/walk
Package walk reads a list to its end, one page at a time, in the order of the list's key.
|
Package walk reads a list to its end, one page at a time, in the order of the list's key. |
|
platform/weblink
Package weblink builds the links Hardcount sends people to, such as an emailed link or the page Stripe returns a customer to, under an address an operator set.
|
Package weblink builds the links Hardcount sends people to, such as an emailed link or the page Stripe returns a customer to, under an address an operator set. |
|
recipe
Package recipe implements pricing recipes.
|
Package recipe implements pricing recipes. |
|
session
Package session implements dashboard sessions, issued by the email and password login (ADR-011).
|
Package session implements dashboard sessions, issued by the email and password login (ADR-011). |
|
subscription/subscriptiontest
Package subscriptiontest holds test-only fixtures for the subscription domain, in the same shape as platform/leader/leadertest.
|
Package subscriptiontest holds test-only fixtures for the subscription domain, in the same shape as platform/leader/leadertest. |
|
tax
Package tax defines the tenant-selectable tax calculation backend and three concrete implementations: NoneProvider (skip tax), ManualProvider (flat tenant-level rate), and StripeTaxProvider (Stripe Tax API; defers the invoice to tax_status=pending for retry on error).
|
Package tax defines the tenant-selectable tax calculation backend and three concrete implementations: NoneProvider (skip tax), ManualProvider (flat tenant-level rate), and StripeTaxProvider (Stripe Tax API; defers the invoice to tax_status=pending for retry on error). |
|
testutil
Package testutil holds helpers that tests share: the integration test database (SetupTestDB, AdminPool), a database role for one test (CreateRole), a wait for a backend blocked on a lock (WaitForLockWaiter), and small readers for credit balances and the mode on a context.
|
Package testutil holds helpers that tests share: the integration test database (SetupTestDB, AdminPool), a database role for one test (CreateRole), a wait for a backend blocked on a lock (WaitForLockWaiter), and small readers for credit balances and the mode on a context. |
|
testutil/pdftest
Package pdftest reads back what Hardcount's PDF renderers drew, for tests.
|
Package pdftest reads back what Hardcount's PDF renderers drew, for tests. |
|
usage
Provider cost rates + per-customer margin (ADR-079).
|
Provider cost rates + per-customer margin (ADR-079). |
|
user/breachedpw
Package breachedpw holds the breached-password list that user.ValidatePassword checks when a password is set or reset (ADR-095, "Offline breached-password").
|
Package breachedpw holds the breached-password list that user.ValidatePassword checks when a password is set or reset (ADR-095, "Offline breached-password"). |
|
user/breachedpw/gen
command
Command gen rebuilds internal/user/breachedpw/passwords.txt from a downloaded copy of the source list.
|
Command gen rebuilds internal/user/breachedpw/passwords.txt from a downloaded copy of the source list. |
|
version
Package version carries the build-time version stamp.
|
Package version carries the build-time version stamp. |
Click to show internal directories.
Click to hide internal directories.