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 the local SQLite database, 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, sqlitePath string, pricing sessions.PricingTable) (string, func(), error)
Start spins up an in-process tapes API server backed by the SQLite database at sqlitePath. 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's /v1/sessions/summary handler. nil is acceptable; the handler falls back to sessions.DefaultPricing in that case.
Types ¶
This section is empty.