Documentation
¶
Overview ¶
Package fingerprint provides content-based static asset fingerprinting.
It walks a source directory, hashes each file's contents (SHA-256, first 12 hex chars), and writes fingerprinted copies (name.HASH.ext) to a separate output directory. A generated Go source file maps original paths to fingerprinted paths at compile time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsFingerprinted ¶
IsFingerprinted reports whether the given URL path contains a fingerprint hash.
Types ¶
type Manifest ¶
Manifest maps original relative paths to their fingerprinted counterparts.
func Fingerprint ¶
Fingerprint walks srcDir, hashes each file, and writes fingerprinted copies to distDir (mirroring the directory structure). The distDir is wiped first to remove stale files from previous runs.
func (*Manifest) WriteGoManifest ¶
WriteGoManifest writes a Go source file declaring a StaticManifest variable with the manifest entries baked in as a map literal.