inprocessapi

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

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's /v1/sessions/summary handler. nil is acceptable; the handler falls back to sessions.DefaultPricing in that case.

Types

This section is empty.

Jump to

Keyboard shortcuts

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