Documentation ¶
Overview ¶
Package filer contains a simple HTTP server for static resources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asseter ¶
type Asseter interface { IsDir(name string) (bool, error) Asset(name string) (io.ReadCloser, error) }
An Asseter resolves resources by name.
type Filer ¶
type Filer struct {
http.FileSystem
}
A Filer serves static resources.
func New ¶
func New(fs http.FileSystem) (*Filer, error)
New creates a new filer which uses the Asseter to retrieve assets.
func (*Filer) ServeHTTP ¶
func (f *Filer) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP returns files from the file system. The file has to be located in the directory configured to the static server or a subdirectory. HTTP errors are raised if the requested file does not exist or another error occured.
Click to show internal directories.
Click to hide internal directories.