Documentation
¶
Overview ¶
Package static contains static assets and code relating to serving of static assets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHandler ¶
AddHandler adds a handler to router serving static assets (JS, CSS, etc) from within go binary. Enabling developer mode sources files from local disk instead and starts a live reload server, which reloads the browser whenever static files change.
Types ¶
type CacheBuster ¶
CacheBuster provides a cache-busting filesystem wrapper, mapping paths with a specific format containing a sha256 hash to paths without the hash in the wrapped filesystem. i.e. mapping
/css/main.1fc822f99a2cfb6b5f316f00107a7d2770d547b64f3e0ea69baec12001a95f9f.css -> /css/main.css
var (
AssetsFS *CacheBuster
)
Click to show internal directories.
Click to hide internal directories.