live

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 9 Imported by: 1 module, 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 live provides the host-side LiveProvider implementations: probe (the /-/version convention), command (the universal adapter - any CLI's output is the answer) and static (a ref handed in directly, e.g. piped to the CLI). Deployment records live in the gitlab package, beside the forge that keeps them, and the assumed fallback lives in the core engine, because only the engine knows Green.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseOutput

func ParseOutput(out string) (onair.LiveInfo, error)

ParseOutput applies the command output contract: a JSON object {commit, builtAt, state}, or a single token that is a SHA, a tag, or an image ref whose tag part is the answer. The same parser backs the CLI's pipe form (`kubectl ... | onair --live-ref -`).

Types

type Command

type Command struct {
	Command string
	Dir     string // working directory; empty means inherit
}

Command is the universal live provider: run a user-supplied command and treat its stdout as the answer to "what is live". kubectl, flyctl, ssh + docker inspect, even the heroku CLI - all one seam, no per-platform adapters. Confidence is Reported: user-asserted truth we did not observe ourselves.

Contract: stdout is a commit SHA or anything resolvable to one (a tag, an image ref whose tag is the SHA), or a JSON object {commit, builtAt, state}. A non-zero exit means Live is unavailable - the engine degrades to Assumed = Green.

func (*Command) Live

func (c *Command) Live(ctx context.Context) (onair.LiveInfo, error)

type Probe

type Probe struct {
	URL string
	// HTTPClient defaults to a client with a 10s timeout.
	HTTPClient *http.Client
}

Probe reads a /-/version-style endpoint where the running artifact self-reports: {"commit":"a1b2c3d","builtAt":"..."}. Highest fidelity - this is the app itself speaking.

func (*Probe) Live

func (p *Probe) Live(ctx context.Context) (onair.LiveInfo, error)

type Static

type Static struct {
	Info onair.LiveInfo
}

Static answers with a ref that was handed in directly - the CLI's `--live-ref` pipe form, or a host that already knows what is running.

func (Static) Live

Jump to

Keyboard shortcuts

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