k3s/pkg/static/zz_generated_bindata.go

275 lines
457 KiB
Go
Raw Normal View History

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