Documentation
¶
Overview ¶
Package inprocessapi provides a shared helper for CLI subcommands that want to talk to the tapes API server over HTTP without requiring an external server. It opens a local PostgreSQL-backed storage driver, runs migrations, and starts an api.Server bound to a random localhost port. Callers receive the loopback URL and a stop function to invoke at shutdown.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
func Start(ctx context.Context, postgresDSN string, pricing sessions.PricingTable) (string, func(), error)
Start spins up an in-process tapes API server backed by PostgreSQL using postgresDSN. Returns the loopback URL the caller should use to construct an HTTP client, plus a stop function that must be invoked at shutdown to release the listener and close the storage driver.
pricing is passed through to the API server, which uses it to fold cost totals on the legacy node-layer /v1/stats fallback. nil is acceptable; the server falls back to sessions.DefaultPricing in that case.
Types ¶
This section is empty.