web

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 32 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 web is the read-only web UI wrapper over the core, served by bb serve. Handlers call core operations and render templ components; they hold no domain logic and never change the system: every action is shown as a command to copy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Export added in v0.2.0

func Export(ctx context.Context, eng *core.Engine, dir string) error

Export writes the docs, the starters and the landing page to dir as a static site. Every page comes from the same handlers as bb serve.

Types

type Options

type Options struct {
	// Dir is the project directory; experiment.yaml is found from here.
	Dir string
	// Addr is the listen address; empty means 127.0.0.1 on a free port.
	// Only loopback addresses are accepted.
	Addr string
	// Refresh is how often live pages update; zero means 2 seconds.
	Refresh time.Duration
}

Options configures a Server.

type Server

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

Server is a running UI.

func New

func New(eng *core.Engine, opts Options) (*Server, error)

New listens on a loopback address and returns the server. Call Serve to start answering and URL for the address to open.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the guarded router.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context) error

Serve answers requests until ctx is cancelled.

func (*Server) URL

func (s *Server) URL() string

URL is the address to open. It carries the launch token, which the server exchanges for a session cookie on first use.

Directories

Path Synopsis
Command site writes the docs, the starters and the landing page of the web UI as a static site, for breadboard.b8z.me.
Command site writes the docs, the starters and the landing page of the web UI as a static site, for breadboard.b8z.me.

Jump to

Keyboard shortcuts

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