embedsupport

package
v1.800.4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 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 embedsupport wires up the optional embedded filesystems for conf, web/build, and skills. When the binary is built with -tags embed, the caller (main) passes the embedded fs.FS values here via Setup. At runtime, on-disk files always take priority; the embedded versions are used only when the corresponding directory is absent next to the executable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeEmbedded

func ServeEmbedded(w http.ResponseWriter, r *http.Request, urlPath string)

ServeEmbedded serves a frontend asset from the embedded web/build FS. urlPath is the raw request URL path (e.g. "/", "/static/js/main.abc.js"). Must only be called when WebFS() != nil.

func Setup

func Setup(conf, web, skills fs.FS)

Setup must be called at the very start of main(), before any config values are read or HTTP requests are served.

func SkillsFS

func SkillsFS() fs.FS

SkillsFS returns the embedded skills filesystem, or nil if not available.

func WebFS

func WebFS() fs.FS

WebFS returns the embedded web/build filesystem, or nil if not available.

Types

This section is empty.

Jump to

Keyboard shortcuts

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