Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetEntry ¶
type AssetEntry struct {
LogicalPath string
DiskPath string // For disk-based (dev mode)
// contains filtered or unexported fields
}
AssetEntry represents a single static asset that can be fingerprinted and served.
func (*AssetEntry) URL ¶
func (e *AssetEntry) URL() string
URL returns the URL for the asset. In dev mode: returns plain path (no fingerprint) for live reload. In prod mode: returns fingerprinted path for cache busting.
type Assets ¶
type Assets struct {
// contains filtered or unexported fields
}
Assets manages fingerprinted static assets with build overlay support.
func LoadAssets ¶
LoadAssets loads assets from filesystem (dev mode - live reload). Implements build overlay: checks build/ first, falls back to root.
func LoadAssetsFS ¶
LoadAssetsFS loads assets from embed.FS (prod mode - single binary). Implements build overlay: checks build/ first, falls back to root.
func (*Assets) Entries ¶
func (a *Assets) Entries() map[string]*AssetEntry
Entries exposes the internal map for convenience.
func (*Assets) Entry ¶
func (a *Assets) Entry(logical string) (*AssetEntry, error)
Entry retrieves the AssetEntry for the given logical path. In dev mode, returns an entry even for assets not registered at startup. Returns an error if Assets is nil, path is invalid, or asset not found (prod mode).
func (*Assets) MustEntry ¶
func (a *Assets) MustEntry(logical string) *AssetEntry
MustEntry retrieves the AssetEntry for the given logical path. Panics if the asset is not found or path is invalid. Use this in templates where error handling is not practical.