cli

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 55 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DaemonReadinessTimeout added in v0.8.0

func DaemonReadinessTimeout() time.Duration

DaemonReadinessTimeout exposes the readiness window so external tests can assert it stays above the document-extractor probe ceiling (ingest.DoclingProbeTimeout). Read-only accessor.

func ExtractPortFromAddress

func ExtractPortFromAddress(addr string) string

ExtractPortFromAddress extracts a numeric trailing port token from a host:port address or malformed best-effort address string.

func IsDaemonStillStarting added in v0.8.0

func IsDaemonStillStarting(err error) bool

IsDaemonStillStarting reports whether err indicates the daemon child was still alive but had not yet written connection.json when the readiness deadline expired (as opposed to having crashed). Exported so the readiness classification — still-starting vs crashed vs ready — can be unit-tested from the external tests package without exposing waitForConnectionFile.

func PublicURLAddress

func PublicURLAddress(configuredListenAddr, resolvedListenAddr string) string

PublicURLAddress derives the public-facing address using the configured listen host and the resolved runtime port.

func WaitForConnectionReady added in v0.8.0

func WaitForConnectionReady(path string, childPid int, timeout time.Duration) (bool, error)

WaitForConnectionReady is a thin exported wrapper over waitForConnectionFile so the readiness classification — ready vs still-starting vs crashed — can be exercised from the external tests package (waitForConnectionFile itself stays unexported). It returns whether the connection became ready and the classifying error; pair it with IsDaemonStillStarting to distinguish the healthy-but-slow case from a child that exited before binding.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func NewApp

func NewApp() *App

NewApp constructs an App wired to os.Stdout and os.Stderr.

func NewAppWithIO

func NewAppWithIO(stdout, stderr io.Writer) *App

NewAppWithIO constructs an App with the given output writers and the default ingestor/store constructors.

func NewAppWithIOAndHooks

func NewAppWithIOAndHooks(stdout, stderr io.Writer, hooks RuntimeHooks) *App

NewAppWithIOAndHooks constructs an App with the given writers, overriding the default ingestor/store/retriever constructors with any non-nil hooks (used by tests to inject fakes).

func (*App) Run

func (a *App) Run(args []string) int

Run is the process entrypoint: it installs a signal-cancelled context, dispatches args, and maps a clean exit after interruption to the signal-interrupt exit code.

func (*App) RunWithContext

func (a *App) RunWithContext(ctx context.Context, args []string) int

RunWithContext parses global flags and dispatches the remaining command under ctx, printing usage when no command is given.

type RuntimeHooks

type RuntimeHooks struct {
	NewIngestor  func(config.Config, model.Store) (model.Ingestor, error)
	NewStore     func(config.Config) model.Store
	NewRetriever func(config.Config, model.Store) model.Retriever
}

Jump to

Keyboard shortcuts

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