ui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package ui is the local admin page, drawn inside toolshell. It reaches live state only through the engine, the same path the CLI takes, and keeps no state beyond the last plan it ran per target. The command that starts it wraps it in toolshell/guard: loopback only, Host check, no cross-site writes, capped bodies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	// Name is the binary name, shown in commands the page tells you to run.
	Name string
	// ConfigPath is re-read on every request, so an edit shows without a
	// restart.
	ConfigPath string
	// Activity records what the page did; nil records nothing.
	Activity *activity.Log
	// Providers is what the engine plans with.
	Providers engine.Providers
	// DriftPath is the file the drift command saves; empty shows no drift.
	DriftPath string
	// Host is the address the page is served on, shown in the sidebar.
	Host string
	// Has reports whether a program is on PATH; swapped in tests.
	Has func(name string) bool
	// Now is swapped in tests.
	Now func() time.Time
}

Deps is everything the page needs from the command that starts it.

type Server

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

func New

func New(deps Deps) (*Server, error)

New wires the routes.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) Warm

func (s *Server) Warm(ctx context.Context)

Warm measures every target once, so the first page shows at once.

Jump to

Keyboard shortcuts

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