Documentation ¶
Overview ¶
Package assets hold utilities for serving static assets.
The actual assets live in auto subpackages instead of here, because the set of assets varies per program.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MimeTypeForFile ¶
MimeTypeForFile returns the appropriate MIME type for an asset, based on the filename.
We use a built in table of the common types since the system TypeByExtension might be unreliable. But if we don't know, we delegate to the system. All our text files are in UTF-8.
Types ¶
type Asset ¶
type Asset struct { Content string // Contents of asset, possibly gzipped. Gzipped bool Length int // Length of (decompressed) Content. Filename string // Original filename, determines Content-Type. Modified time.Time // Determines ETag and Last-Modified. }
An Asset is an embedded file to be served over HTTP.
Click to show internal directories.
Click to hide internal directories.