mirror of
https://github.com/minio/minio.git
synced 2025-03-19 20:14:16 -04:00
292 lines
1.4 MiB
Go
292 lines
1.4 MiB
Go
|
// Code generated by go-bindata.
|
||
|
// sources:
|
||
|
// dist/app.css
|
||
|
// dist/index.html
|
||
|
// dist/main.js
|
||
|
// DO NOT EDIT!
|
||
|
|
||
|
package main
|
||
|
|
||
|
import (
|
||
|
"bytes"
|
||
|
"compress/gzip"
|
||
|
"fmt"
|
||
|
"github.com/elazarl/go-bindata-assetfs"
|
||
|
"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 _distAppCSS = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\x55\x41\x6f\xdb\x3c\x0c\xbd\xe7\x57\xe8\xeb\x87\x01\xed\x10\x05\x4e\x0a\x0f\x83\x73\xda\x6d\xe7\x9d\x76\x95\x2d\x3a\x12\x22\x8b\x82\x24\x27\x69\x8b\xfd\xf7\xd1\xb2\x9d\xda\x69\x3a\x34\x40\x1d\xc4\xb6\xa4\xc7\xc7\x27\x92\xa2\x8b\x1a\xab\x36\xb0\x17\x6c\xa3\xd1\x16\x0a\x8b\x16\xd8\x7f\xba\x71\xe8\xa3\xb0\x71\xfb\x67\x51\x14\xbc\xc1\x67\x9e\x70\x5c\x5b\x0b\x9e\xbd\x94\xe8\x25\xf8\x22\x9b\x23\x17\x5f\xd9\xcb\x82\xd1\xd5\x08\xbf\xd3\xb6\x60\xd9\x96\x39\x21\xa5\xb6\xbb\xee\x3d\x2d\xd5\x68\x23\xaf\x45\xa3\xcd\x53\xc1\xee\x7e\x61\x89\x11\xef\x96\xec\x27\x98\x03\x44\x5d\x89\x25\xfb\xe1\xb5\x30\x4b\x16\x84\x0d\x3c\x80\xd7\xf5\x76\x41\xd4\xab\x8a\x0c\xc1\xc6\xc1\xc3\x99\x76\x93\xb9\x53\x0f\x50\xd8\x00\x17\xce\x81\xf0\x03\x08\x9d\xa8\x74\x24\x3f\xd9\x2a\x5b\xf7\xee\xa3\x27\x5a\x1d\x35\x92\xba\x61\x99\xad\x1e\x03\x03\x11\x80\x36\xf7\x86\x69\xfa\xce\x45\x15\xf5\x01\x2e\xc9\xd7\xbd\x11\x49\x3d\x80\x0f\x9f\xa3\x60\x4e\x76\x31\xfc\x98\x0e\x03\xe2\x63\x98\xf9\xe8\x1d\xf2\x1b\xf5\x1f\x34\x41\xd0\x07\xb6\x0a\x4e\xf8\x7d\x57\x59\x03\x63\xad\x8d\x29\x58\x57\x65\x3d\x5d\x88\x1e\xf7\x50\xd0\x13\xc0\x94\xa6\x9d\x4d\xf3\xa3\x96\x51\x91\xec\x55\x3e\x66\x79\xe7\x85\x53\x9f\xc4\x55\x09\x2f\x07\x2a\xa9\x83\x33\x82\x36\x5a\x1a\xac\xf6\xbd\x1d\x52\x54\x6a\x83\xc7\x82\x29\x2d\x25\xd8\x7e\xd6\xe1\xb8\x7b\x0f\x46\x74\xb1\xea\xe7\xf9\x11\xca\xbd\x8e\xdc\x51\x28\x1d\xa4\x20\x92\xb3\x2c\x4b\xf5\xc9\x26\xd7\x55\xc0\x28\xa7\x50\x9d\xd7\x41\x54\xd5\xfa\x80\xbe\x60\x0d\x5e\x3a\x99\x26\x61\x1d\xe6\xfc\xd7\xd6\x66\x76\x35\xfa\x86\x87\xf8\x64\xc8\xbf\xf3\x90\xd2\xcf\x1f\xe5\x15\x96\x77\x91\x09\x5a\x8a\x6a\xbf\xf3\xd8\x5a\xc9\x2b\x34\x9d\xd0\xff\xeb\x3a\xdf\xe4\x9b\x9e\x69\x98\x3b\x2a\x1d\x61\xcb\xd2\x0e\xb5\x95\x70\xe2\x93\xb0\x8f\x76\x79\x9e\x6f\x2f\x10\x4b\x36\x85\x4f\x73\x15\xd1\x51\x41\x8e\x61\xf5\x7a\xa7\xe2\x64\xfc\xcc\x93\x59\x17\xda\x7e\x42\x41\x8f\x58\x7f\x3f\x63\x5e\x73\xa8\xad\xa2\x16\x13\x87\xd2\xc6\xb6\x52\xe9\x00\x74\x4b\xaf\x75\xd5\x77\x3b\xee\x85\xd4\x6d\xa0\x96\x33\xd2\x9c\x63\x44\x25\x57\x09\x03\xbf\xef\xd7\x0f\x17\x2b\x1c\x49\x5f\xd7\x0a\x93\x4c\x96\x67\x5f\x5e\x95\xbe\x8d\x9f\xdf\x95\xf7\x9b\x3c\x5f\xb2\xf1\xf6\x30\x4f\x5f\x89\x27\x1e\x94\x90\x5d\x4d\x92\x0a\xf6\x48\xff\xee\x49\x94\x9d\xad\xb8\xcf\x96\xe9\xb7\x1a\x75\xa4\xce\x7d\xb3\xd5\x4d\x06\xa9\x61\x82\x90\xe7\xaa\xed\x9b\x3f\x4f\x59\x5a\xe7\xe3\x66\xdf\x64\x7a\xb0\x51\x9b\x7f\x9c\xc0\xf4\xb1\x08\xfa\x19\xd2\xb1\x85\x66\x08\x2e\x9c\x22\x17\x46\xef\x28\xac\x15\x7d\x12\xc0\x5f\xd6\x0e\x53\xdf\x6e\x66\x9d\xca\xce\xcf\x39\xba\xee\xeb\x6f\x00\x00\x00\xff\xff\xa1\x96\xf3\xc1\x35\x07\x00\x00")
|
||
|
|
||
|
func distAppCSSBytes() ([]byte, error) {
|
||
|
return bindataRead(
|
||
|
_distAppCSS,
|
||
|
"dist/app.css",
|
||
|
)
|
||
|
}
|
||
|
|
||
|
func distAppCSS() (*asset, error) {
|
||
|
bytes, err := distAppCSSBytes()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
info := bindataFileInfo{name: "dist/app.css", size: 1845, mode: os.FileMode(436), modTime: time.Unix(1443161717, 0)}
|
||
|
a := &asset{bytes: bytes, info: info}
|
||
|
return a, nil
|
||
|
}
|
||
|
|
||
|
var _distIndexHTML = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x94\x51\xbd\x4e\xf4\x30\x10\xec\xbf\xa7\xf0\x67\x4a\x84\x8d\x90\xa0\x38\x39\x47\x41\x45\x71\x0d\x6f\xe0\xd8\x9b\x64\xb9\x8d\x37\xb2\x17\x74\x79\x7b\x62\xac\x93\x4e\x5c\x03\x4a\x91\xd5\x68\x34\x3f\x1e\xf7\x3f\x72\x90\x75\x01\x35\xc9\x4c\xfb\x7f\xae\xfd\x94\x72\x13\xf8\x58\x8f\xed\x14\x14\x82\xfd\x01\x13\xb2\x7a\xe1\x24\x99\x89\x20\x3b\xdb\xf0\xc6\x21\x4c\x47\x35\x65\x18\x3a\x3d\x89\x2c\x65\x67\xed\xb0\x51\x8b\x19\x99\x47\x02\xbf\x60\x31\x81\x67\x1b\x4a\x79\x1e\xfc\x8c\xb4\x76\x6f\xdc\xb3\xb0\x56\x19\xa8\xd3\x45\x56\x82\x32\x01\x88\x56\x35\x4f\xa7\x05\x4e\x52\xe9\xfa\x8f\x0e\x18\x38\x9d\x2d\x0e\x5e\x20\xa3\xa7\xdb\xd7\x0d\x2c\xd7\x56\x97\xd2\x57\x31\x9a\x97\xb5\x21\x26\xf3\x5e\x22\x10\x7e\x66\x93\x40\xec\x40\x70\xea\xf9\x34\x66\x8c\xf6\xc9\x3c\x98\xfb\x4b\xc4\xcc\x98\x4c\x8d\xfd\xb3\x86\xba\xee\xe1\x97\xa5\x51\x7f\xf3\x04\xce\x9e\x27\x71\x3d\xc7\x55\x7d\xd3\x3b\xdd\xfb\x70\x1c\x33\x7f\xa4\x78\x17\x98\x38\xef\xd4\xcd\xf0\x58\xbf\x73\xb9\x12\x32\x2e\xa2\x4a\x0e\x9d\x9e\x3d\xd6\x2e\x7a\xef\x6c\x83\x9b\x70\xd5\xdb\xb6\xb7\x6d\xfc\xaf\x00\x00\x00\xff\xff\xde\x72\x3f\xd6\x14\x02\x00\x00")
|
||
|
|
||
|
func distIndexHTMLBytes() ([]byte, error) {
|
||
|
return bindataRead(
|
||
|
_distIndexHTML,
|
||
|
"dist/index.html",
|
||
|
)
|
||
|
}
|
||
|
|
||
|
func distIndexHTML() (*asset, error) {
|
||
|
bytes, err := distIndexHTMLBytes()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
info := bindataFileInfo{name: "dist/index.html", size: 532, mode: os.FileMode(436), modTime: time.Unix(1443161717, 0)}
|
||
|
a := &asset{bytes: bytes, info: info}
|
||
|
return a, nil
|
||
|
}
|
||
|
|
||
|
var _distMainJs = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xec\xbd\xeb\x76\x1b\xb9\xb1\x30\xfa\x3b\x7e\x8a\x36\xbf\x64\xd4\xb4\x28\x8a\x17\x5d\xa9\xf1\x78\x39\xf6\x4c\xc6\x5f\x7c\x99\xcf\x72\x26\x99\xc8\x8a\x56\x93\x6c\x52\x6d\x91\x6c\x4e\x37\x29\x89\xf6\x68\xaf\xbd\xd7\x3a\xaf\xf4\xbd\xc0\x79\x80\x93\x57\x3a\x55\x85\x5b\x01\x8d\x26\x29\xdb\xe3\x4c\xf6\xd6\xec\x1d\x99\x0d\x14\x0a\x85\x42\xa1\x50\x28\x14\x80\x70\x30\x9f\xf4\x66\x49\x3a\x09\xe2\x70\x56\x9b\xd4\xb2\xea\x07\x9d\x92\x87\x69\x6d\x5e\xfd\x90\x0c\xc2\xfb\x93\x93\xf4\x54\xfc\x9a\xd1\xaf\xcb\x28\x0b\xa2\x87\xb3\xc5\x34\x4e\x07\x41\x16\xff\x3c\x4f\xb2\xf8\xe1\xc3\x8a\x2a\x5a\xf9\xea\x2b\x99\x78\x84\x65\xe6\x5f\x7d\x15\x55\xb3\x78\x36\xcf\x26\x41\x04\x48\xef\x37\xaa\x98\x9e\xa8\xb4\x44\xa6\x21\xd6\xc1\xc3\x49\x7c\x15\x7c\x9b\x65\x69\x16\x56\x9e\x44\x93\x49\x3a\x0b\x06\xc9\xa4\x1f\x8c\xd3\xfe\x7c\x14\x07\x1b\x95\xcd\x74\xb3\xb2\x51\xa9\x1e\xcd\xce\xb3\xf4\x2a\x18\xd4\x7b\x69\x3f\x7e\x58\x79\xf1\xea\xe9\x5f\x9e\x7f\x7b\xf6\xf2\xd5\x9b\xb3\xef\x5e\xfd\xe5\xe5\xd3\x4a\x6d\x70\x83\xf8\x46\x0f\x91\xf6\x87\x1f\xe2\xeb\x69\x9a\xcd\xf2\xce\x87\x9b\x9b\x23\x6c\xc3\x49\xe3\xb4\xde\x8b\x46\xa3\x70\x54\x97\x59\x35\x45\x7d\x18\x8b\x06\x4e\x1e\x12\x60\xf3\xf4\x24\x3e\x3d\x92\xa4\xe6\xe1\xe4\xd1\xa4\x13\x57\x6f\x6a\xa3\x9a\x29\x19\xd7\x04\xef\x6e\x24\x14\x56\xa9\x32\x89\x8a\x64\x2d\x5e\x0d\xa0\xcd\x08\x9d\x3e\x6c\x1c\xa5\x5f\x67\xf5\x51\x3c\x19\xce\xce\x8f\xd2\xcd\xcd\x6a\x1e\x66\xc8\x78\x4d\xc6\x4d\x35\xfc\xd0\xec\x9c\x68\x92\x25\x8a\x9a\xe0\x52\x4d\xd6\x5d\xfd\x70\x6f\xfb\xc1\xbd\xe0\x41\xf0\x22\x99\x24\x69\xf0\x64\x94\xce\xfb\xc1\xf1\x2c\xcd\xa2\x61\x5c\x0b\xc2\x27\xd5\xa0\xd5\x68\xee\x8a\xdc\x5a\xf0\x6c\xd2\xab\x03\x30\xc2\x3f\x4f\x7a\xf1\x24\x8f\xfb\xc1\x7c\xd2\x8f\xb3\x60\x76\x1e\x07\x8f\xa7\x51\x0f\xfe\x91\x39\xb5\xe0\xc7\x38\xcb\x51\x4a\x5a\xf5\x46\x10\x22\xc0\x86\xcc\xda\xa8\x1e\x21\x8a\x45\x3a\x0f\xc6\xd1\x22\xc0\x0e\x9c\xe7\x31\xe0\x48\x72\xe8\x49\xe8\xc2\xf8\xba\x17\x4f\x67\x41\x32\x09\x7a\xe9\x78\x3a\x4a\xa2\x49\x2f\x0e\xae\x92\xd9\x39\xd5\x23\xb1\x20\x25\xc1\x4f\x12\x47\xda\x9d\x45\x00\x1e\x41\x81\x29\x7c\x0d\x38\x60\x10\xcd\x24\xd1\xf8\xdf\xf9\x6c\x36\xed\x6c\x6f\x5f\x5d\x5d\xd5\x23\x22\xb8\x9e\x66\xc3\xed\x91\x00\xcd\xb7\x9f\x3f\x7b\xf2\xed\xcb\xe3\x6f\xb7\x80\x68\x59\xe8\x2f\x93\x51\x9c\xe7\xaa\x5f\xfa\x41\x77\x11\x44\x53\x20\xaa\x17\x75\x81\xd4\x51\x74\x15\xa4\x20\xea\xc3\x2c\x86\xbc\x59\x8a\x44\x5f\x65\xc9\x2c\x99\x0c\x6b\x41\x9e\x0e\x66\x57\x51\x16\x23\x9a\x7e\x92\xcf\xb2\xa4\x3b\x9f\x59\x3c\x53\x24\x42\xcb\x39\x00\x70\x2d\x9a\x04\x1b\x8f\x8f\x83\x67\xc7\x1b\xc1\x1f\x1f\x1f\x3f\x3b\xae\x21\x92\xbf\x3e\x7b\xf3\xfd\xab\xbf\xbc\x09\xfe\xfa\xf8\xf5\xeb\xc7\x2f\xdf\x3c\xfb\xf6\x38\x78\xf5\x3a\x78\xf2\xea\xe5\xd3\x67\x6f\x9e\xbd\x7a\x09\x5f\xdf\x05\x8f\x5f\xfe\x14\xfc\xf9\xd9\xcb\xa7\xb5\x20\x06\x8e\x41\x3d\xd0\xd5\x19\xb6\x00\xc8\x4c\x90\x9b\x71\x9f\x58\x77\x1c\xc7\x16\x09\x20\x5b\xf4\x9d\x4f\xe3\x5e\x32\x48\x7a\xd0\xb4\xc9\x70\x0e\x72\x10\x0c\xd3\xcb\x38\x9b\x40\x8b\x82\x69\x9c\x8d\x93\x1c\x7b\x35\x07\x02\xfb\x88\x66\x94\x8c\x93\x59\x34\xa3\xa4\x42\xbb\xb0\xa2\xed\x7b\xf7\x36\xb0\x7b\xb1\x75\xbd\xd9\xc6\xd1\xbd\x7b\x28\xc1\x67\xbd\x2c\x8e\x66\xf1\x93\x51\x04\x94\x3d\x0c\x8c\x96\x09\xab\xc1\x87\x40\x7f\xf5\x63\x18\xda\xf1\x0f\x59\x0a\x35\xcf\x92\x38\x0f\x67\x51\x36\x8c\x67\xb5\x60\x0a\x49\x39\x81\x02\xd9\x34\x26\x12\x40\xd3\x38\x82\x7f\xbe\x16\x99\x6a\x70\x04\x09\x8c\x0e\x00\x44\x98\x7e\x9c\xf7\xb2\x64\x0a\xf2\x0d\xc0\x04\x75\x92\x9c\x1e\xb1\xe4\x7a\x3c\x99\x8f\xe3\x8c\xba\xf6\x61\x49\xfa\x2f\xbf\x04\x83\x68\x94\xc7\x56\xb9\x5e\x3a\x19\x24\xc3\xb9\x2a\x39\xcb\xe6\x90\x9f\x0c\x82\x70\xe3\x32\x1a\xcd\xe3\x0d\x94\x0b\x03\x5e\xe5\x45\x51\x5c\xac\x62\xaf\xba\xef\xe2\xde\xac\x6e\xb5\x7d\xa1\x5b\xce\x4a\x5e\xc4\x0b\xfe\x5d\x3d\x0a\x6e\xe0\xff\xa4\x06\x30\x1c\x7d\x02\x7d\x03\x98\x7b\x00\x42\x8c\x9b\xa5\x88\x34\x07\xf9\xc4\x8e\xeb\xfd\xa0\x58\x89\xe4\x9a\xec\x6a\x91\xf9\x0c\x51\x9d\x00\x51\x67\x71\x94\x55\xd1\x66\x0b\xef\x32\x2c\x36\x09\x47\x8a\x74\x06\x01\x4d\x82\xff\xaf\x86\x55\x25\x37\xc0\x03\x60\x94\x6e\x1c\x7c\x86\x67\xd7\xb5\xe0\xec\xba\x85\x7f\xda\xaa\xa7\xcf\
|
||
|
|
||
|
func distMainJsBytes() ([]byte, error) {
|
||
|
return bindataRead(
|
||
|
_distMainJs,
|
||
|
"dist/main.js",
|
||
|
)
|
||
|
}
|
||
|
|
||
|
func distMainJs() (*asset, error) {
|
||
|
bytes, err := distMainJsBytes()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
info := bindataFileInfo{name: "dist/main.js", size: 1832125, mode: os.FileMode(436), modTime: time.Unix(1443161728, 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){
|
||
|
"dist/app.css": distAppCSS,
|
||
|
"dist/index.html": distIndexHTML,
|
||
|
"dist/main.js": distMainJs,
|
||
|
}
|
||
|
|
||
|
// 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{
|
||
|
"dist": {nil, map[string]*bintree{
|
||
|
"app.css": {distAppCSS, map[string]*bintree{}},
|
||
|
"index.html": {distIndexHTML, map[string]*bintree{}},
|
||
|
"main.js": {distMainJs, 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, "/")...)...)
|
||
|
}
|
||
|
|
||
|
func assetFS() *assetfs.AssetFS {
|
||
|
for k := range _bintree.Children {
|
||
|
return &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: k}
|
||
|
}
|
||
|
panic("unreachable")
|
||
|
}
|