Documentation ¶
Overview ¶
Create easily a http Handler for static file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func HtmlMinify ¶
Types ¶
type Server ¶
type Server struct { Body []byte Mime string Minify Minifier // contains filtered or unexported fields }
func Css ¶
func Css() *Server
A binding of File for Css file.
http.HandleFunc("/style.css", static.Css(nil, "front/style/"))
func Html ¶
func Html() *Server
A binding of File for Html file.
http.HandleFunc("/", static.Html(nil, "front/index.html"))
func Js ¶
func Js() *Server
A binding of File for Js file.
http.HandleFunc("/app.js", static.Js(nil, "front/app.js"))
func SVG ¶
func SVG() *Server
A binding of File for SVG image.
http.HandleFunc("/icon.svg", static.Svg(nil, "front/icon.svg"))
func (*Server) File ¶
Server a static content with a min Content-Type header.
The content is by default d. If f is non empty, the function read recurrent from f serve it. The reading error are silent.
The served content are minify (expect if Dev is enable) with min. If min is nil, the content are not minify.
func (*Server) FileJoinPath ¶
Like Server.File() but with a splietd path
type Template ¶
Can be breaken
func NewTemplate ¶
func NewTemplate() *Template
func (*Template) FileJoinPath ¶
Click to show internal directories.
Click to hide internal directories.