archive/staticResources.go

282 lines
28 KiB
Go
Raw Normal View History

2017-08-13 01:57:08 +00:00
// Code generated by go-bindata.
// sources:
// static/archive.js
// static/index.php
// static/style.css
// DO NOT EDIT!
package archive
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
)
func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
}
var buf bytes.Buffer
_, err = io.Copy(&buf, gz)
clErr := gz.Close()
if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
}
if clErr != nil {
return nil, err
}
return buf.Bytes(), nil
}
type asset struct {
bytes []byte
info os.FileInfo
}
type bindataFileInfo struct {
name string
size int64
mode os.FileMode
modTime time.Time
}
func (fi bindataFileInfo) Name() string {
return fi.name
}
func (fi bindataFileInfo) Size() int64 {
return fi.size
}
func (fi bindataFileInfo) Mode() os.FileMode {
return fi.mode
}
func (fi bindataFileInfo) ModTime() time.Time {
return fi.modTime
}
func (fi bindataFileInfo) IsDir() bool {
return false
}
func (fi bindataFileInfo) Sys() interface{} {
return nil
}
var _archiveJs = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x39\xfb\x73\xdb\x36\x9a\x3f\xc7\x33\xfe\x1f\xa0\x6f\x73\x12\x10\xc2\x94\x68\x27\x4e\x0d\x1a\xd6\xa5\xae\xdb\xa6\x4d\xba\x9d\x6d\x7a\x73\x1d\x8a\xcd\x81\x24\x48\xb1\xe6\x43\x25\x21\xc7\x8e\xa8\xfb\xdb\x6f\x00\x92\x7a\x58\x49\x3a\xbd\x99\x9d\xec\x8a\xe0\x87\xef\xfd\xa6\x7b\x7c\x34\x7e\x86\xf2\x72\x59\x4b\x55\x89\x05\xba\x73\xec\xe7\xf6\x39\x0a\x2b\x91\x26\x76\x5a\x8f\x6f\xd3\x2c\x4b\x8b\x64\x9c\xa7\xa1\x44\xcf\xc6\xc7\x47\x38\x5e\x16\xa1\x4a\xcb\x02\xff\x40\x2b\x1a\x93\x55\xff\x8e\x6a\x2c\x68\x40\x23\xb2\x12\xb6\x88\xa2\x9b\x3b\x59\xa8\x37\x69\xad\x64\x21\xab\xe9\x21\x08\x07\x34\xa2\x03\x87\x30\x61\x0b\xa5\x44\x38\x37\xb7\x18\xca\x02\x2c\xcd\x65\xbd\xe1\xfb\x0a\x0b\xb2\x4a\x63\x0c\xb7\xf2\x61\x51\xc9\xba\x06\xce\x85\xad\x1e\x16\x92\xac\xee\x44\x85\x02\xfe\x8b\xaa\xd2\x22\xb1\xe3\xaa\xcc\xaf\xe7\xa2\xba\x2e\x23\x89\x85\xfd\x61\x9e\x86\x73\xe2\x0a\xbb\x9e\xa7\xb1\xfa\x51\x3e\x34\x0d\x0e\x78\x60\xab\xf2\x4d\xf9\x41\x56\xd7\xa2\x96\x98\x10\xb7\x92\x6a\x59\x15\x28\x58\x77\x87\xb9\xd7\x91\xfa\xd3\xed\x91\x7d\xbd\x85\x6e\x8f\xec\x4b\x82\xf7\xe5\x6c\xcd\x51\xda\x1c\xc1\x45\xd3\xac\xd6\x6e\xab\xff\xc0\xa1\x91\x1b\x97\x15\x8e\x50\x5a\xa0\x82\x08\x2f\xf2\xa7\x01\x1f\x4c\x58\xe1\x45\x3e\x9f\xb8\x41\xd3\xe0\x25\x1f\x38\x3b\x6c\xae\x5b\x6f\xd3\x90\x4a\x7a\xd7\x3a\x22\xa1\xb7\x34\xe6\x9e\x4f\xe7\x3c\x32\xfe\x71\xd3\x18\x0f\x32\x4f\xf8\xa4\xb5\xcd\xf3\x5d\xed\xc4\xe5\x02\x38\x9f\x0f\x87\x1f\xb0\x20\xc3\x21\x0e\xb8\xc6\x30\xf2\x13\x3e\x71\x93\x4b\x4d\x61\x67\xb2\x48\xd4\xdc\xb5\xac\x84\xa4\x31\xbe\xe5\xc7\x47\x1a\xec\x25\x3e\x1d\xe0\x41\x38\x1c\xde\xda\xb5\xfc\x73\x38\x2c\x3c\x73\xf0\x07\xfc\xd6\xce\xe4\x9d\xcc\x9a\x66\xae\xcf\xc2\x68\xd9\x34\x3b\x51\x1b\xf0\x79\xd3\x44\x76\x2e\x95\x30\xc1\x88\xec\x50\x55\xd9\x8f\xf2\x81\x0c\x87\x81\x5d\x97\x95\xc2\xc4\xfe\xa3\x4c\x0b\x0c\x14\xc8\x80\xf3\x5b\x3b\x2f\xa3\x34\x4e\x65\x55\x1f\x5c\x93\xd6\xe4\x9c\xf7\xaa\xf0\xf6\x64\x74\xe0\xfc\xce\xed\x94\x0c\xcb\x3c\x28\x39\x97\x4d\x93\x93\xe1\xd0\x58\x56\x2f\xb2\x34\x94\x38\xa1\x0e\x71\x63\x7b\xb1\xac\xe7\xf8\x96\xf4\xd1\x8f\xb7\x1e\xfe\x51\x07\xaa\x0d\x90\xe7\xef\xa4\x91\xd6\xd6\x50\x81\x81\x80\x4e\x31\x91\xed\xdf\x88\xac\x85\x77\x16\x6e\x2f\x34\xc0\xdc\x74\x6e\xd8\xde\x68\x00\xec\xa4\xe3\x46\x8f\xfb\x3e\xd2\x64\x95\xdb\xb5\x2a\x17\xd7\x22\xcb\x02\x11\xde\xe2\x80\x06\xb6\x12\x55\x22\x55\xd3\x04\x76\x5d\x85\x37\x99\xcc\x65\xa1\x0c\x72\xd3\x0c\x9c\x01\xe7\x42\x17\x1a\xd1\xa9\x6f\x2f\x2a\xa9\x6b\xec\x1b\x19\x8b\x65\xa6\xa6\x8f\x01\x98\xb0\xc0\x6e\xc5\xff\x97\xc8\x96\x52\xa7\x65\x60\x04\xfe\x5c\x95\x0b\x91\x08\xad\xcd\xf4\xf8\xe8\x00\x66\x08\x43\x51\x84\x32\xfb\x7a\x19\x04\x99\xe4\x83\xc9\x4e\xa6\x3e\x68\x3f\x42\xb1\xcc\x03\x59\xc1\x80\x73\x9d\x99\x65\x8c\xba\x3a\x19\x0e\xfb\x8a\xe1\xc2\xbe\x95\x0f\xba\x86\x48\x57\x17\xba\xf2\xdd\x60\x38\xc4\x9b\xac\x6d\xeb\x7e\x38\xfc\xc8\x39\x0f\xa6\x1f\xf9\xc0\x61\xb9\x3d\x17\x45\x94\xc9\x1f\xe5\x03\x0e\xa8\x0e\x1a\x15\x64\x47\xbc\xce\xf2\x55\x6b\x56\x17\x30\xae\x8b\xaf\x8d\x44\x7b\xd4\xd1\x6a\x4f\x26\x08\x9c\x8b\x2d\xf9\x9b\xad\xf7\x37\x30\x89\x83\x9e\x25\xda\xb4\x43\xb2\x5a\xf2\xc0\xb5\xac\xc2\x13\xbe\x1b\x66\x52\x54\xef\xd2\x5c\x96\x4b\x85\xbf\x21\xee\x37\xbc\x96\xaa\x7f\x57\xd4\xb9\x39\x23\xeb\xad\x8c\x3b\xcd\xef\x1e\x47\x34\xa0\x82\xf4\x25\x3a\x30\x19\x8d\x3f\xf2\x57\x38\x20\xc4\xdd\xa7\xd7\xfe\x2d\x2b\x6c\xaa\x9e\x6b\x89\xa6\x70\x83\xdd\xaa\x35\xa9\x1b\xf3\xc4\x72\xb4\xaf\xba\x9b\xe9\x1d\x93\x38\x6c\x9a\x1b\x1c\x78\x89\xe5\xf8\xa4\x2b\x54\xe2\x7e\xab\x21\x3e\x8d\x69\x48\x05\x4d\x76\xb5\xbb\xd1\x1e\x68\xd9\x45\xf4\xf8\x48\x37\x1c\xdd\x65\xdc\x88\x83\x05\x9c\x73\x31\xf5\xc0\x02\x9f\x09\x53\x59\x0a\x83\x05\x6d\x37\x91\x7c\xe2\xca\xcb\x68\xab\x94\x24\x21\x8f\x3c\xe9\xd3\xef\xbc\xd0\x1f\x0e\x71\xc8\xf5\x81\xd0\x60\x38\xdc\x6d\x13\xc1\x70\xf8\x7d\x8f\xa0\x0f\x34\xde\xaf\x37\x42\x3f\xe0\x90\x0c\x87\x1d\x38\x24\x6e\xc4\x43\x57\xf2\xc0\xf4\x3b\x69\x86\xc5\x60\x41\x56\x0b\xbe\x5a\xbb\x1b\x37\xe9\xd6\x3a\x27\x17\x2f\x2e\x93\xe1\xd0\x71\x4e\xaf\x92\xa6\x99\xdb\x73\x51\xff\xf3\x43\xa1\x73\x59\x56\xea\x01\x27\xba\x1f\x2e\xbc\xb9\x97\xf8\x3e\x4f\xc8\x5a\xf2\x85\x
func archiveJsBytes() ([]byte, error) {
return bindataRead(
_archiveJs,
"archive.js",
)
}
func archiveJs() (*asset, error) {
bytes, err := archiveJsBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "archive.js", size: 7807, mode: os.FileMode(488), modTime: time.Unix(1459655879, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _indexPhp = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x4c\x8f\x4d\x6b\xf3\x30\x10\x84\xcf\xef\xc2\xfe\x87\x3d\x04\xf2\x01\xaf\x75\x69\x2f\x71\x21\xf4\x23\xd0\x40\x28\xc1\xb1\xcf\xaa\x9a\x28\x96\xc0\x48\xea\x6a\xdd\xd8\x94\xfe\xf7\xe2\xf6\xd2\x39\xcc\x5c\x66\x60\x9e\xbb\x4d\x72\x09\x01\x41\xad\x10\xe8\xd1\x19\xa1\x7b\x3e\x39\xff\x61\x33\x02\xbd\xfe\x15\x02\x55\xf6\xbd\xf7\x6c\x33\x1d\x9e\x0f\x74\x5b\xdc\xd0\x22\xbb\xc8\xf2\xdf\x30\x9b\x91\xf2\x18\xc4\x0c\x64\xc2\x99\xb6\x2f\xb5\x3e\x36\x0f\xc7\x7a\x57\x37\xf5\x76\x49\x57\x2f\x8e\x7e\xba\x3a\x26\x1b\xb4\x98\x16\x81\x9a\x6a\x4f\x6c\xaf\xec\xc5\x87\x96\x2e\x91\x29\xb4\x3e\x0c\x25\x02\x21\x74\xf1\x64\xc4\xc7\x40\x8a\x3e\x11\xfe\x09\x8f\xfa\xe2\x3b\x9b\x69\xd6\xb3\x27\xe5\xc3\xd9\x0e\x45\x72\x69\x33\x33\xdc\xe6\x12\xe1\x6b\xc2\x58\xa9\xc9\xf9\xf7\x27\x69\xfd\xb4\xab\xb4\x2e\xe6\xaa\x28\x94\x0f\xa7\xae\x3f\xdb\xac\xde\x62\x94\x2c\x6c\xd2\x34\x9f\x97\x08\x4d\xb5\xaf\x62\x2f\x96\xd7\x6b\x9e\x72\xc2\xb4\x59\x16\xcb\x12\xe1\x3b\x00\x00\xff\xff\x92\x62\xd7\x25\x21\x01\x00\x00")
func indexPhpBytes() ([]byte, error) {
return bindataRead(
_indexPhp,
"index.php",
)
}
func indexPhp() (*asset, error) {
bytes, err := indexPhpBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "index.php", size: 289, mode: os.FileMode(488), modTime: time.Unix(1459655879, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _styleCss = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x57\x49\x73\xe2\xb8\x1e\x3f\x93\xaa\x7c\x07\xd5\xe4\x30\x33\xdd\x21\xd8\x84\xb0\x38\x97\x67\x08\x6b\x12\x08\x84\x25\xe1\x32\x25\xdb\xc2\x16\xc8\x96\xb1\x64\xc0\x74\xf5\x77\x7f\x25\x59\xa6\x1d\x3a\x99\xc3\xab\x7a\x39\x10\x5b\xfa\xef\xeb\xcf\xa5\x6f\xa0\xe5\x41\x0e\x60\x64\x7b\x78\x87\x18\xf8\x56\xba\xbc\xb8\xbc\x28\x7d\x03\x2f\xd0\x45\x80\xf1\x84\x20\x75\xe6\x71\x9f\x80\x1f\x97\x17\x05\xba\x43\xd1\x8a\xd0\x7d\x31\x31\x98\x1d\x51\x42\xee\x2f\x2f\x7e\xa6\xf7\xd7\x16\x75\x12\x49\xe4\xc3\xc8\xc5\x81\xa1\xdd\x87\xd0\x71\x70\xe0\x1a\xda\xbd\x45\x23\x07\x45\x86\x76\x7f\x79\x51\x58\xd1\x80\x17\x57\xd0\xc7\x24\x31\xfe\x78\x45\x2e\x45\x60\xd6\xff\xe3\xda\x8c\x30\x24\xd7\x0c\x06\xac\xc8\x50\x84\x57\x27\x52\x86\x8f\xc8\xd0\xcb\xe1\x21\xd5\x05\xa5\x0e\x9b\x12\x1a\x19\xc0\x22\x31\x12\x84\x76\x1c\x31\xf1\x1e\x52\x1c\x70\x14\xa5\x94\x31\xf9\x68\xce\xe5\x45\x41\x59\x54\x24\x68\xc5\x8d\xb2\x96\xc9\xbc\xf1\x71\x80\x8b\x0c\x85\x30\x82\x9c\x46\x92\xcd\xc1\x2c\x24\x30\x31\x00\x0e\x08\x0e\x50\xd1\x22\xd4\xde\x08\x19\x47\x4a\x7d\x03\xe8\xe2\xd1\x43\xd8\xf5\xb8\x01\xf4\xaa\x94\x54\xd8\x63\x87\x7b\x06\x48\xe5\x16\x52\xa7\x53\x5d\x40\x0f\x0f\x80\x51\x82\x1d\xe0\xc0\x68\xe3\x46\x28\xc9\x91\x44\x4a\xcc\x89\xe6\xea\xe1\xe1\x21\x35\x8d\x21\x82\x6c\x7e\xee\xc8\x4f\x95\xa9\x27\x98\xd0\x98\xab\x2c\xdd\x10\xf9\x56\xe4\x34\x94\xf4\x21\x65\x98\x63\x1a\x18\x60\x85\x0f\xc8\x11\xfa\x38\x0d\x0d\x20\x23\x91\x5a\x25\x1f\x95\x76\x2d\xef\x51\x39\x8d\x37\x00\x00\x64\x59\x04\xb7\xa7\xa3\xd4\x92\xa2\x45\x39\x17\xb1\xa8\x9f\xe2\xa8\x2c\x38\x2b\x05\x61\x91\x51\x51\x51\xc9\xc4\xdd\x9e\x33\x85\x31\xf3\x1c\xba\x0f\x3e\xda\x1e\x21\x02\x39\xde\xa1\xcc\xfa\x13\x9b\xf4\x5f\x16\xb0\xa8\x54\x1c\xb8\x2a\x0a\x57\xb6\x07\x39\x8c\x50\x5a\x27\x7b\x1a\x39\x45\x2b\x42\x70\x63\xc8\xdf\xa2\x38\xc8\x04\xdc\x70\xec\x23\xc6\xa1\x1f\x82\x1f\xaa\xa0\xae\x9a\xcd\xe6\xbd\x30\x4a\x48\x01\x3f\x84\xb3\x40\x56\xe1\x3e\x0d\x8c\x45\x89\xa3\x82\x90\xfd\x29\x4e\x91\x56\x59\x8e\x82\x9b\x25\x4c\x31\xa7\xdc\xb2\x99\x0c\xcc\x21\xc1\xf6\xd7\xec\x6e\x84\x50\x20\xf9\x09\x75\xa9\x12\xa0\x6a\x4a\xd7\x7e\x65\x24\xfb\xcb\x92\x75\x5b\xfb\xed\xea\x54\xbd\x59\xd9\xe6\x2f\x73\xdd\x98\x3f\xce\x9a\x23\x4b\xab\x7e\xa3\x21\x5f\x9a\xe3\x66\xa1\xc8\xcc\xbd\xd2\x4c\xed\xfe\xb7\xb8\x48\xcb\x45\xaf\x78\xd8\xf5\x88\x38\x47\x8e\xcc\x82\x05\xed\x8d\x1b\xd1\x38\x70\x0c\x79\x9c\x20\x42\xe8\x3e\x97\xc7\x29\xa5\xc4\x82\xd1\x59\x2a\x6f\x42\xe8\x64\x8a\x33\x87\xd2\x6e\xbc\x3f\x55\xa5\x26\xab\x2f\x4d\x67\x00\x77\x19\xf9\xe5\x45\xa1\x90\x57\x9b\x75\x94\x38\xa5\x87\x22\xf3\xa0\x43\xf7\xb2\x53\x41\x25\x3c\x80\xb2\xf8\xb9\x6a\xb5\x5a\xaa\x24\x85\xa4\x15\x8d\x7c\xf0\x03\x9c\xcd\x81\xfb\xec\xfa\xc6\xe2\x41\xaa\x2d\xaf\x66\xef\x61\x8e\x3e\xcd\xb0\x45\xe0\x57\x89\xc8\x35\xbe\x0c\x8f\x9a\x0e\x9f\xe4\xc6\x00\x1a\x50\xb3\xa6\x50\xe0\xe8\xc0\x8b\x0e\xb2\x69\x04\x65\xab\x04\x34\x40\xe9\x4d\x66\x23\x34\x3c\x31\xb1\xc1\x0f\x35\x67\x54\xad\x09\xf9\x40\xda\xa3\x7e\xa5\x42\x19\xc3\xcb\x8b\x1b\xd1\x3b\x45\x86\xc4\x5a\x90\xc9\x5b\x11\x0a\xb9\x21\x87\x44\x1a\x9d\xab\xf4\xd2\xa2\x87\xb4\xc5\x64\x81\xea\x35\xed\x57\x67\x5e\xa5\xf5\x9b\x9b\xa2\xe7\x43\x54\x31\x29\x5f\x54\x21\x67\xaf\xb9\x80\xf2\x08\x06\x2c\x84\x11\x0a\x38\x88\x23\xf2\xd7\x9f\x0e\xe4\xd0\xc0\x3e\x74\x51\x29\x0c\xdc\x7b\x0b\x32\x54\xad\x5c\xe3\x79\x73\x34\xd9\x6b\x8f\x5d\x97\x9a\xa6\x69\x0e\x5f\x67\x5e\x7b\xe6\x9a\xa6\xd9\x14\xaf\xe6\xb8\x65\xbe\x8b\xff\xab\x7a\xa9\xe1\x89\x87\xee\xdb\xa4\xb3\xe8\x4d\xa6\x56\x79\xa9\x39\xe5\x4e\xb2\x1c\x37\x9b\xcb\x6e\x03\x2f\x5f\x9b\x03\x6b\xd1\x09\x96\xf3\x01\x79\x5f\x4c\xee\x6c\x9b\x90\x17\xc1\x60\xf1\xc1\xa4\xdd\x99\x8d\x9e\x79\x63\x63\xe9\x5b\x93\xb4\xc7\x1e\xb4\x07\xd5\xf1\xa0\x39\x1d\xb4\xf1\xf4\xf5\x21\x6c\x6f\xf7\xfa\xfa\x7d\xd1\x0f\xc7\x0d\xb7\xff\xde\x5f\xb8\x1e\xf4\xdb\x4f\xdd\x84\x4d\xda\x5a\x9b\x6a\xdd\xc9\x64\x1c\xb5\x12\x46\xfa\x8f\x7d\x5c\xf2\x66\x70\x3f\xef\xb7\x57\xef\x8b\xfa\xbe\x3b\x1d\xad\x2d\xc6\x92\xe5\xb6\x63\x1d\x83\xe7\x11\x42\xc9\xe8\xce\x1e\x79\xfb\x91\x43\x39\x61\xdf\x59\xb3\xe4\x2f\x87\xdd\xdd\xbc\x76\xcb\x1d\xce\x9b\xdc\x0c\x1e\x1a\xeb\x5d\xa3\x0a\x67\xc9\xf7\xb
2017-08-13 01:57:08 +00:00
func styleCssBytes() ([]byte, error) {
return bindataRead(
_styleCss,
"style.css",
)
}
func styleCss() (*asset, error) {
bytes, err := styleCssBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "style.css", size: 3943, mode: os.FileMode(420), modTime: time.Unix(1502600381, 0)}
2017-08-13 01:57:08 +00:00
a := &asset{bytes: bytes, info: info}
return a, nil
}
// Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func Asset(name string) ([]byte, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
}
return a.bytes, nil
}
return nil, fmt.Errorf("Asset %s not found", name)
}
// MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables.
func MustAsset(name string) []byte {
a, err := Asset(name)
if err != nil {
panic("asset: Asset(" + name + "): " + err.Error())
}
return a
}
// AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
}
return a.info, nil
}
return nil, fmt.Errorf("AssetInfo %s not found", name)
}
// AssetNames returns the names of the assets.
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
}
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"archive.js": archiveJs,
"index.php": indexPhp,
"style.css": styleCss,
}
// AssetDir returns the file names below a certain
// directory embedded in the file by go-bindata.
// For example if you run go-bindata on data/... and data contains the
// following hierarchy:
// data/
// foo.txt
// img/
// a.png
// b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) {
node := _bintree
if len(name) != 0 {
cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(cannonicalName, "/")
for _, p := range pathList {
node = node.Children[p]
if node == nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
}
}
if node.Func != nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
rv := make([]string, 0, len(node.Children))
for childName := range node.Children {
rv = append(rv, childName)
}
return rv, nil
}
type bintree struct {
Func func() (*asset, error)
Children map[string]*bintree
}
var _bintree = &bintree{nil, map[string]*bintree{
"archive.js": &bintree{archiveJs, map[string]*bintree{}},
"index.php": &bintree{indexPhp, map[string]*bintree{}},
"style.css": &bintree{styleCss, map[string]*bintree{}},
}}
// RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error {
data, err := Asset(name)
if err != nil {
return err
}
info, err := AssetInfo(name)
if err != nil {
return err
}
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil {
return err
}
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
if err != nil {
return err
}
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
if err != nil {
return err
}
return nil
}
// RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error {
children, err := AssetDir(name)
// File
if err != nil {
return RestoreAsset(dir, name)
}
// Dir
for _, child := range children {
err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil {
return err
}
}
return nil
}
func _filePath(dir, name string) string {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}