webui

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package webui provides the web management UI API and static file serving.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterUI

func RegisterUI(mux *http.ServeMux, api *API)

RegisterUI registers the web UI routes (static + API) on the given mux.

func StaticHandler

func StaticHandler() http.Handler

StaticHandler returns an http.Handler that serves the embedded SPA. All requests to /ui/* are served from the embedded static/ directory.

Types

type API

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

API provides JSON API endpoints for the web UI.

func NewAPI

func NewAPI(cfg APIConfig) *API

NewAPI creates a new API handler.

func (*API) RegisterRoutes

func (a *API) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers API routes on the given mux.

type APIConfig

type APIConfig struct {
	DB         *storage.DB
	TokenStore *token.Store
	Logger     *slog.Logger
	GetConfig  func() config.Config
	ToggleMW   func(name string, enabled bool)
}

APIConfig holds dependencies for creating the API.

Jump to

Keyboard shortcuts

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