Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractAssetID ¶
ExtractAssetID checks if a long hexadecimal string is contained in given file path and returns the original file name and ID (if any). For instance <foo.badbeedbadbeef.min.js> = <foo.min.js, badbeefbadbeef>
func GetLanguageFromHeader ¶
GetLanguageFromHeader return the language tag given the Accept-Language header.
Types ¶
type AssetRenderer ¶
AssetRenderer is an interface for both a template renderer and an asset HTTP handler.
func NewDirRenderer ¶
func NewDirRenderer(assetsPath string) (AssetRenderer, error)
NewDirRenderer returns a renderer with assets opened from a specified local directory.
func NewRenderer ¶
func NewRenderer() (AssetRenderer, error)
NewRenderer return a renderer with assets loaded form their packed representation into the binary.
type Handler ¶
type Handler struct{}
Handler implements http.handler for a subpart of the available assets on a specified prefix.
func (*Handler) ServeFile ¶
func (h *Handler) ServeFile(w http.ResponseWriter, r *http.Request, f *modelAsset.Asset, checkETag bool)
ServeFile can be used to respond with an asset file to an HTTP request