Documentation
¶
Overview ¶
Package moesif provides a block-partitioned, stateful Moesif management API for the API Portal's billing.
It answers the Moesif calls the API Portal makes: the billing catalog (plans and prices), billing meters, the connection to Stripe, and the usage search. Catalog prices are created in the testbench's Stripe service, as Moesif syncs its catalog to Stripe, and the usage a billing meter counts is reported to Stripe against the meter's price. It also receives the Stripe events sent to Moesif's Stripe endpoint. Control endpoints under /test record counted usage, fail chosen requests, and report the stored state.
Index ¶
Constants ¶
const Port = 3023
Port is the container port used by the testbench.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Billing ¶
type Billing interface {
// AddPrice adds a catalog price to the account of the partition key.
AddPrice(key string, spec stripe.PriceSpec) error
// ArchivePrice stops new subscriptions to a price.
ArchivePrice(key, priceID string) error
// RecordUsage adds usage to a subscription's metered price. The subscription is named by its
// id or by a value in its metadata; its id is returned.
RecordUsage(key, subscriptionRef, priceID string, quantity int64) (string, error)
}
Billing is the Stripe account Moesif syncs its catalog to and reports counted usage to.