embedsupport

package
v1.800.3 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: 0

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