shared

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package shared provides static assets shared across all unum web UIs.

Index

Constants

This section is empty.

Variables

View Source
var Assets embed.FS

Functions

func FreePort

func FreePort() (int, error)

FreePort returns a random free TCP port on localhost.

func OpenBrowser

func OpenBrowser(url string)

OpenBrowser opens url in the default browser after a short delay.

func PrintStartupBanner

func PrintStartupBanner(toolName, url string)

PrintStartupBanner writes the tool startup lines to stderr.

func ServeAsset

func ServeAsset(fs embed.FS, path, contentType string) http.HandlerFunc

ServeAsset serves a file from fs at path with the given Content-Type.

func ServeSharedAsset

func ServeSharedAsset(path, contentType string) http.HandlerFunc

ServeSharedAsset serves a file from the shared Assets embed.

func ServeTemplate

func ServeTemplate(fs embed.FS, path string) func(d IndexData) http.HandlerFunc

ServeTemplate parses the named template from fs and serves it with data d.

Types

type IndexData

type IndexData struct {
	DarkTheme  string
	LightTheme string
}

IndexData holds the theme config injected into HTML templates.

Jump to

Keyboard shortcuts

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