Documentation
¶
Overview ¶
Package shared provides helpers shared across CLI sub-packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeContext ¶
func MakeContext(timeoutMs int) (context.Context, context.CancelFunc)
MakeContext returns a context with an optional timeout. The caller must defer cancel() to avoid resource leaks.
func WithConnection ¶
func WithConnection(conn string, timeout int, fn func(ctx context.Context, drv driver.Connection) error) error
WithConnection resolves a connection, runs fn, and handles cleanup and error output. Errors from resolution or fn are written to stderr as structured JSON.
Types ¶
Click to show internal directories.
Click to hide internal directories.