console

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package console provides the embedded web console for operating a Starport gateway: playground chat, the Starmap model catalog, provider status, key management, and gateway settings. The built single-page console is embedded in the binary so it works offline with a strict same-origin content security policy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PageServer

type PageServer interface {
	Register(r chi.Router)
}

PageServer registers console page and asset routes on a router.

type SPAHandler

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

SPAHandler serves the built single-page console: hashed immutable assets under /assets/ and the SPA index for every page path, so the client router owns navigation (spaFallback).

func NewSPAHandler

func NewSPAHandler(logger *zerolog.Logger) (*SPAHandler, error)

NewSPAHandler creates a handler over the embedded console build.

func (*SPAHandler) Assets

func (h *SPAHandler) Assets(w http.ResponseWriter, r *http.Request)

Assets serves the hashed build outputs. The content hash in every asset filename makes the response immutable.

func (*SPAHandler) Built

func (h *SPAHandler) Built() bool

Built reports whether the embedded build contains the console.

func (*SPAHandler) Index

func (h *SPAHandler) Index(w http.ResponseWriter, _ *http.Request)

Index serves the SPA shell for a page path. index.html stays no-cache so a new binary always delivers the matching hashed assets.

func (*SPAHandler) Register

func (h *SPAHandler) Register(r chi.Router)

Register mounts the SPA page routes and hashed assets on the router. Every console page path serves the same shell (spaFallback); the client router renders the matching page.

Jump to

Keyboard shortcuts

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