web

package
v0.11.9 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 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 embeds the relay-ui single-page app and serves it from the control plane.

The built UI dist is fetched at image-build time (a pinned relay-ui release tarball untarred into ./dist; see the Dockerfile and `make ui-fetch`) and baked into the binary via go:embed. The embed lives here in the composition root rather than under app/ so the http API packages stay asset-free.

Serving is same-origin by design: the UI resolves the control API to window.location.origin when VITE_CONTROL_API_URL is unset, so mounting it on the control listener needs no runtime config, no CORS, and no cookie relaxation. Out of scope: a standalone UI port (deliberately folded onto the control plane — disable via RELAY_UI_DISABLE instead).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(apiURLs ...string) http.Handler

Handler serves the embedded SPA: real files (assets, favicon, ...) are served directly; everything else falls back to index.html so client-side routes resolve. Intended to be registered as the control router's NotFound handler, after all API operations — matched API paths never reach it. apiURLs are the control/inference URLs the UI is configured to call; their origins join the CSP's connect-src.

func Present

func Present() bool

Present reports whether a real UI dist was baked in. A source/dev build (or any build where ui-fetch did not run) embeds only an empty dist, so the handler must not be mounted — index.html absence is the signal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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