webui

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 28 Imported by: 0 modules, 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 webui serves the embedded, workspace-free shell and trusted fragments.

Index

Constants

View Source
const CSP = "" /* 188-byte string literal not displayed */

Variables

View Source
var ErrAssetsInvalid = errors.New("invalid embedded vendor assets")

Functions

func RenderMarkdown

func RenderMarkdown(markdown string) (template.HTML, error)

RenderMarkdown is the sole trusted-HTML conversion. Raw HTML is disabled in goldmark; the independent allowlist excludes images and all active attributes. Relative links remain inert until resolved against canonical identities.

func SafeURI

func SafeURI(value string) string

SafeURI exposes only explicit HTTP links, without credentials or private query data.

Types

type Dependencies

type Dependencies struct {
	EmbeddingsEnabled bool
	Operator          *app.OperatorService
	Retrieve          func(context.Context, string, []string) (knowlapi.RetrieveResult, error)
	OperationStatus   func(domain.OperationStatus) string
	Operation         func(context.Context, string) (knowlapi.OperationResult, error)
}

Dependencies are read-only presentation inputs. They never expose writers.

type Handler

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

func New

func New(dependencies Dependencies) (*Handler, error)

func (*Handler) Error

func (h *Handler) Error(w http.ResponseWriter, status int, code string)

Error preserves the HTTP failure status and exposes only a stable machine code.

func (*Handler) Fragments

func (h *Handler) Fragments(w http.ResponseWriter, r *http.Request)

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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