Help us shape the future of Go! Take the 2026 Go Developer Survey

examples/

directory
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT

README

Examples

Runnable examples, each with a test. None needs a Stripe account.

Example Shows
catalog A pricing spec, and syncing it to Stripe: a dry run by default, -apply to write
pricingpage A pricing page drawn from the spec, so it cannot disagree with billing
webhook A webhook endpoint: verify, hand to the lifecycle, answer so Stripe retries only what a retry can fix
limits Enforcing a plan's limits and checking a feature level

The catalog in catalog/pricing.json is the spec the other examples read.

go run ./examples/catalog -spec examples/catalog/pricing.json
go run ./examples/pricingpage -spec examples/catalog/pricing.json

Directories

Path Synopsis
Command catalog loads a pricing spec and shows what syncing it to Stripe would do, or does it.
Command catalog loads a pricing spec and shows what syncing it to Stripe would do, or does it.
Package limits shows how a host enforces a plan's limits: ask the spec, and act on the answer.
Package limits shows how a host enforces a plan's limits: ask the spec, and act on the answer.
Command pricingpage serves a pricing page drawn from a pricing spec, so the page and the billing cannot disagree about what a plan costs or includes.
Command pricingpage serves a pricing page drawn from a pricing spec, so the page and the billing cannot disagree about what a plan costs or includes.
Package webhook shows a Stripe webhook endpoint: verify the request, hand the event to the lifecycle, and answer so Stripe retries only what a retry can fix.
Package webhook shows a Stripe webhook endpoint: verify the request, hand the event to the lifecycle, and answer so Stripe retries only what a retry can fix.

Jump to

Keyboard shortcuts

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