web

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package web provides embedded static resources for the Inspector Web UI.

The web package uses Go's embed directive to bundle the compiled frontend assets directly into the binary, enabling zero-dependency deployment.

Usage

// Serve embedded static files
http.Handle("/", web.Handler())

// Or get the filesystem directly
fs := web.FS()

Package web provides embedded static resources for the Inspector Web UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FS

func FS() fs.FS

FS returns the embedded filesystem containing the web UI assets.

func Handler

func Handler() http.Handler

Handler returns an http.Handler that serves the embedded web UI.

func HandlerWithPrefix

func HandlerWithPrefix(prefix string) http.Handler

HandlerWithPrefix returns an http.Handler that serves the embedded web UI with the given URL prefix stripped.

func NewServer

func NewServer(config ServerConfig) http.Handler

NewServer creates a new HTTP handler that serves both the web UI and API.

Types

type ServerConfig

type ServerConfig struct {
	// APIHandler handles /api/* routes.
	APIHandler http.Handler
	// FallbackToIndex enables SPA routing (returns index.html for unknown routes).
	FallbackToIndex bool
}

ServerConfig holds configuration for the web server.

Jump to

Keyboard shortcuts

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