statik

package
v0.0.0-...-4b98c26 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetPath

func AssetPath(domain, name string, context ...string) string

AssetPath return the fullpath with unique identifier for a given asset file.

func ExtractAssetID

func ExtractAssetID(file string) (string, string)

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

func GetLanguageFromHeader(header http.Header) (lang string)

GetLanguageFromHeader return the language tag given the Accept-Language header.

Types

type AssetRenderer

type AssetRenderer interface {
	echo.Renderer
	http.Handler
}

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 NewHandler

func NewHandler() Handler

NewHandler returns a new handler

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

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface.

Jump to

Keyboard shortcuts

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