2015-05-01 20:59:46 +00:00
|
|
|
package server
|
2015-04-26 22:45:49 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"net/http"
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
|
|
|
type BindataFileSystem struct{}
|
|
|
|
|
|
|
|
func (f BindataFileSystem) Open(name string) (http.File, error) {
|
|
|
|
path := "dist" + name
|
|
|
|
|
|
|
|
data, err := Asset(path)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return &BindataFile{bytes.NewReader(data), path}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type BindataFile struct {
|
|
|
|
*bytes.Reader
|
|
|
|
path string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *BindataFile) Close() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *BindataFile) Readdir(count int) ([]os.FileInfo, error) {
|
|
|
|
return make([]os.FileInfo, 0), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *BindataFile) Stat() (os.FileInfo, error) {
|
|
|
|
return AssetInfo(f.path)
|
|
|
|
}
|