web

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package web is part of the GoFastr harness.

See docs/harness-architecture.md for the architecture this package implements.

Package web implements the bundled web client.

v0.1 minimum: serve a minimal HTML+JS shell on a random local port that talks to the engine via the same inproc transport the TUI uses. The page consumes Server-Sent Events from the harness bus and POSTs SendInput via a small JSON endpoint hosted by this same http.Server.

Full GoFastr-App dogfooding (entities, island hydration, framework crud machinery) lands as the harness grows; v0.1 keeps the surface tight so the harness ships a usable browser UI today.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Client  *inproc.Client
	Session ids.SessionID
	// contains filtered or unexported fields
}

Server is the bundled web client.

func New

func New(c *inproc.Client, session ids.SessionID, bus *engine.Bus) *Server

New constructs a Server bound to the given inproc Client + bus.

The bus is needed (in addition to the Client) so each browser subscriber gets its own dedicated channel — the inproc.Client's Subscribe is one-channel-per-client, and we want N browsers to share one engine.

func (*Server) Start

func (s *Server) Start() (string, error)

Start binds a TCP listener on 127.0.0.1:0 (random port) and serves the web UI. Returns the URL to print.

func (*Server) Stop

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

Stop terminates the server.

Jump to

Keyboard shortcuts

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