Versions in this module Expand all Collapse all v1 v1.0.0 Sep 22, 2021 Changes in this version + var ErrEmptyPath = errors.New("cachebusting: empty path provided is invalid") + var ErrFileNotStoredInMemory = errors.New("cachebusting: file not stored in memory") + var ErrHashLengthToShort = errors.New(...) + var ErrNoCacheBustingInDevelopment = errors.New("cachebusting: disabled because Development field is true") + var ErrNoEmbeddedFilesProvided = errors.New("cachebusting: no embedded files provided") + var ErrNoFiles = errors.New("cachebusting: no files provided") + var ErrNotFound = errors.New("cachebusting: file not found") + func Create() (err error) + func Debug(yes bool) + func DefaultConfig() + func DefaultEmbeddedConfig(e embed.FS, files ...StaticFile) + func DefaultOnDiskConfig(files ...StaticFile) + func DefaultStaticFileHandler(cacheDays int, pathToStaticFiles string) http.Handler + func Development(yes bool) + func FindFileDataByCacheBustURLPath(path string) (b []byte, err error) + func GetFilenamePairs() (pairs map[string]string) + func HashLength(l uint) + func PrintEmbeddedFileList(e embed.FS) + func UseMemory(yes bool) + type Config struct + Debug bool + Development bool + EmbeddedFS embed.FS + HashLength uint + StaticFiles []StaticFile + UseEmbedded bool + UseMemory bool + func GetConfig() *Config + func NewConfig() *Config + func NewEmbeddedConfig(e embed.FS, files ...StaticFile) *Config + func NewOnDiskConfig(files ...StaticFile) *Config + func (c *Config) Create() (err error) + func (c *Config) FindFileDataByCacheBustURLPath(urlPath string) (b []byte, err error) + func (c *Config) GetFilenamePairs() (pairs map[string]string) + func (c *Config) StaticFileHandler(cacheDays int, pathToStaticFiles string) http.Handler + type StaticFile struct + LocalPath string + URLPath string + func NewStaticFile(localPath, urlPath string) StaticFile