ui

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 2 modules, 1 package

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

Index

Constants

View Source
const DefaultCSPPolicy = "base-uri 'self'; object-src 'none'; frame-ancestors 'self'"

DefaultCSPPolicy is the Content-Security-Policy served with the UI when none is configured.

Variables

This section is empty.

Functions

func CSP added in v0.10.7

func CSP(policy StringSetting) func(http.Handler) http.Handler

CSP serves the configured Content-Security-Policy. An empty policy sends no header.

func New

func New(path string) http.Handler

Types

type BoolSetting

type BoolSetting func() bool

type Handler

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

func NewUIHandler

func NewUIHandler(opts *Options) *Handler

func (*Handler) IndexFile

func (u *Handler) IndexFile() http.Handler

func (*Handler) IndexFileOnNotFound

func (u *Handler) IndexFileOnNotFound() http.Handler

func (*Handler) ServeAPIUI added in v0.7.16

func (u *Handler) ServeAPIUI() http.Handler

func (*Handler) ServeAsset

func (u *Handler) ServeAsset() http.Handler

func (*Handler) ServeFaviconDashboard

func (u *Handler) ServeFaviconDashboard() http.Handler

type Options

type Options struct {
	// The location on disk of the UI files
	Path StringSetting
	// The HTTP URL of the index file to download
	Index StringSetting
	// Whether or not to run the UI offline, should return true/false/dynamic
	Offline StringSetting
	// Whether or not is it release, if true UI will run offline if set to dynamic
	ReleaseSetting BoolSetting
	// The version of API UI to use
	APIUIVersionSetting StringSetting
	// The Content-Security-Policy to serve the UI with
	CSPPolicy StringSetting
}

type StringSetting

type StringSetting func() string

Jump to

Keyboard shortcuts

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