Documentation
¶
Overview ¶
Package asset contains utilities for serving static asset service like images, css, js, and other files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(stripPrefix string, root fs.FS) echo.HandlerFunc
Handler returns an echo.HandlerFunc that serves static files from the given fs.FS. The stripPrefix parameter is removed from the beginning of requested URLs before looking up files.
func Path ¶
Path appends a cache busting key to the given path URL. If a cache key is not set, it returns the original image path unchanged.
func SetCacheKey ¶
func SetCacheKey(key string)
SetCacheKey sets a cache busting key that will be appended to asset URLs. A good cache key is your app version or git hash. This helps force browsers to download fresh copies of assets when the key changes. Warning: Not Goroutine safe. Set once in main().
Types ¶
This section is empty.