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 ¶
- func BrowserURL(ctx context.Context, ep Endpoint, next string) (string, error)
- func Engine(ctx context.Context, base *config.Config, dir, token string, lockFD int, ...) error
- func OutdatedNote(runtime version.Info) string
- func SharePath(ctx context.Context, ep Endpoint) (bool, error)
- func StateDir() (string, error)
- func Stop(ctx context.Context) error
- func TmuxDir() (string, error)
- type Endpoint
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BrowserURL ¶ added in v2.7.0
BrowserURL is a link that signs a browser in to the runtime and then opens next (a path such as "/#sessions/new"). The link works once, for ten minutes.
func OutdatedNote ¶ added in v2.6.0
OutdatedNote explains a running runtime that is older than this binary, or returns "" when it is not (or the builds cannot be ordered). Nothing stops the old runtime automatically: it may be running sessions.
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 Peek ¶ added in v2.4.0
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"`
// CLIVersion is the binary asking; Outdated says the running runtime is
// an older build than it. A running runtime is reused whatever its
// version, so this is how a stale one becomes visible.
CLIVersion string `json:"cli_version,omitempty"`
Outdated bool `json:"outdated,omitempty"`
}