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