readiness

package
v1.261116.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MPL-2.0 Imports: 6 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

Overview

Package readiness answers "can the server I just launched actually be reached yet?" for every entry point that starts one (start, restart, open, the TUI). A bound lock file or a forked process proves nothing: the URL a launcher prints is only honest once the HTTP health endpoint answers.

Index

Constants

View Source
const HealthPath = "/api/v1/info/health"

HealthPath is the unauthenticated endpoint a ready server answers 200 on.

Variables

This section is empty.

Functions

func ProbeURL

func ProbeURL(host string, port int) string

ProbeURL returns the health URL for a server bound to host:port. A wildcard or empty host (the CLI binds every interface by default) is probed through localhost, since the wildcard address is not dialable on every platform.

func Wait

func Wait(ctx context.Context, url string, exited <-chan error, timeout time.Duration) error

Wait polls url until it answers 200 and returns nil. It gives up with a *TimeoutError after timeout, with an *ExitedError as soon as exited yields (pass nil if there is no process to watch), or with ctx's error.

Types

type ExitedError

type ExitedError struct {
	Err error
}

ExitedError means the server process ended before it became ready. Err is the process's exit status or the error its Start returned (may be nil).

func (*ExitedError) Error

func (e *ExitedError) Error() string

func (*ExitedError) Unwrap

func (e *ExitedError) Unwrap() error

type TimeoutError

type TimeoutError struct {
	URL     string
	Timeout time.Duration
}

TimeoutError means the server never answered the health endpoint.

func (*TimeoutError) Error

func (e *TimeoutError) Error() string

Jump to

Keyboard shortcuts

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