localruntime

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 23 Imported by: ? 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 localruntime starts the per-user Lectern control plane used by the local CLI. It deliberately keeps its state away from the checkout so a fresh install can run without a hosted server or a configured target.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Engine

func Engine(ctx context.Context, base *config.Config, dir, token string, lockFD int, log *slog.Logger) error

func StateDir

func StateDir() (string, error)

func Stop

func Stop(ctx context.Context) error

Types

type Endpoint

type Endpoint struct {
	URL       string       `json:"url"`
	Token     string       `json:"token"`
	Instance  string       `json:"instance"`
	PID       int          `json:"pid"`
	StartedAt string       `json:"started_at"`
	Build     version.Info `json:"build"`
	TmuxDir   string       `json:"tmux_dir"`
}

func Ensure

func Ensure(ctx context.Context, binary string, base *config.Config) (Endpoint, error)

func Peek added in v2.4.0

func Peek(ctx context.Context) (Endpoint, bool)

Peek reports the local runtime's endpoint, token included, if one is already healthy — without starting one. Unlike StatusOf (whose Endpoint has the token stripped for safe display), a caller here is about to make authenticated requests, e.g. `lectern doctor`'s live checks. It never starts a new engine; that's Ensure's job.

type Status

type Status struct {
	State    string       `json:"state"`
	Endpoint *Endpoint    `json:"endpoint,omitempty"`
	Health   any          `json:"health,omitempty"`
	Detail   string       `json:"detail,omitempty"`
	Version  string       `json:"version,omitempty"`
	Build    version.Info `json:"build,omitempty"`
}

func StatusOf

func StatusOf(ctx context.Context) (Status, error)

Jump to

Keyboard shortcuts

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