Skip to main content

Module host_account

Module host_account 

Expand description

What a host offers a person’s account, and why it refuses an action.

Every place a workspace runs is a host: the person’s own devices, hosts they run themselves, and hosting providers that sell compute. Hosting is not a separate dashboard: a person’s account with a host is what this module describes, and a limit is the host accepting or refusing an action. Billing hangs off that acceptance, never off an app.

A host answers ACCOUNT under PROVIDER with a HostAccount:

  • the plans it offers (PlanOffer); a host that sells nothing offers none and answers no Standing;
  • the account’s Standing: its plan, whether a payment method is on file, what it is entitled to, its usage (Linux VM seconds and bytes stored per workspace) and its limits, and its invoices;
  • where the person manages billing (HostAccount::manage_billing): the provider’s own page, never a form Tilo draws.

The read is live: a host sends a new answer whenever the account changes (a card added, a plan changed, usage recorded), so a view or a waiting command follows it without asking again.

When the host refuses an action that needs what the account lacks, it says so with a Refusal: a typed Reason, the words for whoever ran it, and the NextSteps that would let it through, each with the provider’s URL. The first action that needs a Linux machine on a host that sells them, with no card on file, is refused with Reason::NoPaymentMethod and NextStepKind::AddPaymentMethod: nothing asks for a card before that.

Every type here is written field for field, with enums tagged by their variant, so it crosses both JSON (the action door) and postcard (a host’s own sockets) as the same value.

Payment itself (checkout, prices, webhooks, credit, rate limits, fraud checks) is the provider’s. All it does here is answer this contract: write the account’s standing where its host reads it, and name its pages. The account is the person’s: their Tilo identity carries it to every device, so Settings and the overview of their Tilo show the same standing.

Structs§

HostAccount
A person’s account with one host.
Invoice
One invoice, as the provider issued it.
Limits
The limits of a plan, or of an account on it.
NextStep
One way through a refusal.
PaymentMethod
A payment method on file, as the provider describes it: enough for the person to recognise it (“Visa ·· 4242”), never enough to charge it.
PlanOffer
One plan a host offers.
Refusal
A host’s refusal of an action, for whoever ran it.
Standing
The account’s standing with a host that sells something.
Usage
What the account used in the current billing period.
WorkspaceUsage
How long one workspace’s VMs ran in the period.

Enums§

Entitlement
Something an account may do once its host says so.
HostKind
What kind of place a host is, as the person thinks of it.
InvoiceStatus
Where an invoice stands.
NextStepKind
What would let a refused action through.
Reason
Why a host refused an action.

Constants§

ACCOUNT
Live: the calling person’s account with this host, as a HostAccount.
PROVIDER
The provider a host answers its accounts under, the one it answers its other hosting steps under.
RESOURCE
The resource the account’s actions are actions of.

Functions§

target
The target of action action of RESOURCE.