archive/staticResources.go

282 lines
28 KiB
Go
Raw Permalink 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
}
2017-09-06 06:18:25 +00:00
var _styleCss = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xbc\x57\x5b\x73\xaa\xc8\x16\x7e\xd6\x2a\xff\x03\x35\x79\x98\x99\x9d\x18\xc0\xbb\xe4\xe5\xe0\xfd\x12\x35\x1a\x2f\x89\x2f\x53\x0d\xb4\xd0\xda\xd0\x48\x37\x2a\x4e\xe5\xbf\x9f\xe2\x2a\xb8\x77\xe6\x9c\x3a\x0f\x27\x0f\x86\x86\xd5\xeb\xfa\xad\xd5\x5f\xf3\x3f\x38\xe0\xa8\x06\x3a\x41\x9e\x32\x0f\xc3\x67\x95\x52\xee\x07\x5f\xc8\x17\xf2\xfc\x0f\xee\x0d\xe8\x90\x0b\xde\x47\xef\x0c\x66\x62\xee\xef\x42\x3e\x47\x4e\xd0\xd9\x61\x72\x2e\x7a\x12\x55\x1d\x82\xf1\x4b\x21\xff\x15\x4b\x3c\x29\x44\xf3\x02\x31\x13\x38\x3a\xb2\x24\xe1\xc5\x06\x9a\x86\x2c\x5d\x12\x5e\x14\xe2\x68\xd0\x91\x84\x97\x42\x3e\xb7\x23\x16\x2b\xee\x80\x89\xb0\x27\xfd\xf6\x0e\x75\x02\xb9\xd5\xf0\xb7\x27\xd9\x41\x00\x3f\x51\x60\xd1\x22\x85\x0e\xda\x25\xa2\x14\x5d\xa1\x24\x96\xec\x4b\x6c\x0d\x04\x56\x54\x82\x89\x23\x71\x0a\x76\xa1\x2f\xaa\xba\x0e\xf5\xd7\x36\x41\x16\x83\x4e\x2c\xeb\xe2\xac\x4b\x85\x7c\x2e\xf2\xaa\x88\xe1\x8e\x49\x25\xe1\xa6\xf7\xd9\x44\x16\x2a\x52\x68\x03\x07\x30\xe2\x04\x1b\x35\x44\x6d\x0c\x3c\x89\x43\x16\x46\x16\x2c\x2a\x98\xa8\x07\x5f\xcb\x95\x10\x53\xe2\x44\xff\xd1\x80\x48\x37\x98\xc4\x89\xb5\x40\x57\xee\x8c\x34\x66\x48\x5c\xa8\x39\x17\x86\x1e\x5a\xe3\x44\xfb\xc2\x51\x82\x91\xc6\x69\xc0\x39\xe8\x0e\xf4\x52\x22\x4e\xa4\x26\x91\x79\xe8\x74\x3a\xb1\x73\x14\x62\xa8\xb2\xfb\x60\xbe\xa2\x9a\xbd\x02\x8f\xb8\x2c\xaa\xd7\x33\x0e\x56\x45\x46\xec\x40\xde\x26\x14\x31\x44\x2c\x89\xdb\xa1\x0b\xd4\x7c\x8b\x8c\xd8\x12\x17\x64\x23\xf4\x2b\x78\x8c\xec\x0b\xe9\x98\x4a\x61\xde\xe3\xa4\x49\x5c\x39\x5c\x87\x3e\x14\x15\xc2\x98\x9f\x87\x46\x2a\x8b\x91\xf5\x3b\x38\xf8\xde\x48\x15\x21\xab\xad\xfc\xf3\x36\xdb\xa5\x86\x46\xce\x56\xd6\x73\x07\x62\xc0\xd0\x09\xc6\xbe\xa7\x36\xf2\x3f\xb8\xb6\x01\x58\x80\x58\x64\xe9\x51\x0e\x1e\x54\x03\x30\xe0\xc0\x10\x2b\x67\xe2\x68\x45\xc5\x81\xe0\x20\x05\xbf\x45\xff\x45\x62\x99\x21\x13\x52\x06\x4c\x3b\x8d\xab\x87\x56\xab\x95\x48\xf8\xca\x82\x8f\x01\x20\xcf\x61\x6e\x14\x82\x83\x5c\x46\x1b\xfc\x82\x46\x60\xfc\x2a\xe4\xb9\xd4\x5f\x21\xff\x4c\x3d\x7a\xdb\x1f\xf4\x96\x84\x18\xc0\x48\xbd\x53\xa0\x3b\x10\x5a\xbf\xd4\x80\x89\x4e\xc2\x58\x42\x74\x89\x42\x54\x99\xb8\x52\xe5\x7a\xb8\x4e\x10\x9b\x40\x35\xdd\x7c\x31\xf8\xe3\xc2\x89\xcf\x02\x34\x93\x38\x75\x96\x4a\xc1\x83\x20\xdf\xfa\x35\x1b\x73\x54\x31\xbf\x21\x0c\xa4\x1b\xd8\xff\x06\xb5\x60\xaf\x02\xd4\x83\xee\x10\xd7\xd2\xa4\xe0\xb5\x07\x31\x26\xe7\x54\xb1\x96\x84\x60\x05\x38\x77\xf5\x7a\xb6\x81\x96\x69\xb8\xb0\xdf\xd2\x60\x11\x32\x28\xb3\xc0\x89\xfb\x3b\xce\x4e\xda\x6a\xdc\x35\x39\x85\x5c\x8a\xd4\x00\x1a\x39\x07\xbd\xc8\x55\xec\x0b\x57\xf2\x7f\x1e\xda\xed\x76\xa8\x27\xd0\xb2\x23\x8e\xf9\xab\x5e\xcf\x98\x7a\x56\x98\x75\x1f\x1f\x77\x36\x10\x83\xb7\x0a\x2a\x18\x64\x12\x9e\xea\xe4\x20\x15\x71\xbb\x27\xbd\x24\x70\xd1\xc4\x60\xf0\xc2\x8a\x1a\x54\x89\x03\x02\xb8\x5b\xe4\xce\x3c\x90\x0c\x7f\xf8\x86\x1e\x84\xd3\x22\x42\x8d\xaf\x94\x0b\x2c\x47\xbf\x91\x95\x70\xaf\xdf\x01\x45\x0a\xfd\x69\x1f\xe2\x0f\x13\xc0\xa4\xa0\xd1\x63\x99\x87\xf0\xb3\x42\x2e\x29\x78\x89\xf5\xd4\x5c\x7c\x48\xb0\x97\x2d\xce\x6d\x18\x46\x9b\x6a\x19\x44\xc6\xcb\x54\xc6\x98\x03\x2c\x6a\x03\x07\x5a\x8c\x73\x1d\xfc\xc7\xef\x1a\x60\x40\x42\x26\xd0\x21\x6f\x5b\xfa\x8b\x02\x28\xac\x55\x9e\xd0\xba\x35\x5b\x9c\x85\x71\x5f\x27\xb2\x2c\xcb\xd3\xf7\x95\xd1\x5d\xe9\xb2\x2c\xb7\xfc\xa5\x3c\x6f\xcb\x9f\xfe\xff\x5d\x83\x6f\x1a\xfe\x43\xff\x63\xd1\xdb\x0c\x16\x4b\xa5\xb4\x15\xb4\x52\xcf\xdb\xce\x5b\xad\x6d\xbf\x89\xb6\xef\xad\x91\xb2\xe9\x59\xdb\xf5\x08\x7f\x6e\x16\x55\x55\xc5\xf8\xcd\xdf\xa0\xb0\xd1\xa2\xdb\x5b\xcd\x26\xac\x79\x50\xc4\xa3\x8c\xbb\x73\x03\xa8\xa3\xda\x7c\xd4\x5a\x8e\xba\x68\xf9\xde\xb1\xbb\xc7\xb3\xb8\xff\xdc\x0c\xed\x79\x53\x1f\x7e\x0e\x37\xba\x01\xcc\xee\x6b\xdf\xa3\x8b\xae\xd0\x25\x42\x7f\xb1\x98\x3b\x6d\x8f\xe2\xe1\x78\x88\x78\x63\x05\xce\xeb\x61\x77\xf7\xb9\x69\x9c\xfb\xcb\xd9\x5e\xa1\xd4\xdb\x1e\x7b\xca\xd5\x9a\xcc\x20\xf4\x66\x55\x75\x66\x9c\x67\x1a\x61\x98\x3e\xd2\x16\x6f\x6e\xa7\xfd\xd3\xba\x5e\x66\x1a\x63\x2d\x26\x5b\x9d\xe6\xfe\xd4\xac\x81\x95\xf7\xf8\x31\xdd\x76\x46\x86\x3c\x10\x8e\x8b\xfa\x49\xab\xeb\x8f\xeb\x77\x77\xe3\xae\xdb\xce\x65\xeb\x4c\x17\xf3\xfe\xd4\xc4\xc7\x0f\xa
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
}
2017-09-06 06:18:25 +00:00
info := bindataFileInfo{name: "style.css", size: 3974, mode: os.FileMode(420), modTime: time.Unix(1502600563, 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, "/")...)...)
}