Back to godoc.org

Package statik

v0.0.0-...-7732e28
Latest Go to latest

The highest tagged major version is .

Published: 2 days ago | License: AGPL-3.0 | Module: github.com/cozy/cozy-stack

Index

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.

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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier