assets

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AssetCache map[string]AssetObject
View Source
var AssetMux sync.Mutex

Functions

func AssetsHandler

func AssetsHandler(w http.ResponseWriter, r *http.Request)

Registered handler for the /assets path. Ensure the path name is relative by removing any leading slash or dots. If the resulting path is in the cache, the cached value is returned to the caller. If not in cache, attempt to read the file at the designated path within the assets directory, add it to the cache, and return the result.

func FlushAssetCache

func FlushAssetCache()

Flush the cache of assets being held in memory on behalf of the html services.

func GetAssetCacheCount

func GetAssetCacheCount() int

Get the number of items in the asset cache.

func GetAssetCacheSize

func GetAssetCacheSize() int

Get the current asset cache size.

Types

type AssetObject

type AssetObject struct {
	Count    int
	LastUsed time.Time
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL