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