1
0
Fork 0
mirror of https://github.com/Luzifer/duplicity-backup.git synced 2024-11-08 15:10:06 +00:00
duplicity-backup/bindata.go

294 lines
7.9 KiB
Go
Raw Normal View History

// Code generated by go-bindata. DO NOT EDIT.
2016-05-22 13:04:37 +00:00
// sources:
// help.txt
package main
2016-05-22 13:04:37 +00:00
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
}
2016-05-22 13:04:37 +00:00
type asset struct {
bytes []byte
info fileInfoEx
}
type fileInfoEx interface {
os.FileInfo
MD5Checksum() string
2016-05-22 13:04:37 +00:00
}
type bindataFileInfo struct {
name string
size int64
mode os.FileMode
modTime time.Time
md5checksum string
2016-05-22 13:04:37 +00:00
}
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) MD5Checksum() string {
return fi.md5checksum
}
2016-05-22 13:04:37 +00:00
func (fi bindataFileInfo) IsDir() bool {
return false
}
func (fi bindataFileInfo) Sys() interface{} {
return nil
}
var _bindataHelptxt = []byte(
"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x94\xb1\x72\xdb\x30\x0c\x86\x77\x3d\x05\xc6\x76\x50\xbc\x67\xeb\x25" +
"\x97\xa9\x43\xaf\xbd\x5e\x87\x5c\x06\x84\x82\x24\x5e\x28\x42\x07\x80\x8e\xed\xa1\xcf\xde\xa3\xc8\xd8\xb2\x5d\xdf" +
"\x75\x28\x36\x91\xc0\xc7\x5f\x3f\x40\xfe\x12\x9c\x67\x12\x40\xe1\x14\x3b\xe8\xd2\x1c\xbc\xf3\xb6\x07\x63\x70\x42" +
"\x68\x04\xaf\xe8\xde\xd2\x0c\xef\xde\x46\x08\xa4\x0a\x23\x1e\x0e\x81\x9a\xe6\xa7\xe2\x40\xf7\x0d\x9c\xaa\xda\x9a" +
"\xfb\xec\x78\x9a\x30\x76\x2f\x4d\xf3\x65\x8b\x3e\xe0\x6b\x20\x78\x28\x6b\x9a\x2b\x6a\xde\x06\x7c\x74\x02\x97\xf1" +
"\x70\x76\x30\x3a\xc7\xd2\xf9\x38\x64\x4d\x36\x1e\xd7\x25\x05\xd2\x06\xa0\x4f\x21\x5c\x21\x8e\xf1\xc4\xe2\x48\x97" +
"\xba\xe5\x7f\x3c\x47\xe0\x1e\xb0\x94\x15\x54\x03\xe0\x02\x61\x4c\xf3\x0d\xc8\x23\x05\x32\x5a\x20\xb4\x33\xc1\x48" +
"\x9c\x74\x65\x56\xef\x8b\x94\xe0\xd5\x5a\x37\x62\x1c\xa8\x6b\x97\xc5\x35\xe5\xab\x57\x2b\x4a\xca\x56\x4d\x04\xf5" +
"\xd1\x11\x04\x54\x3b\xe9\x29\xa4\x24\x42\xd1\xfe\x81\xc4\xd1\xd0\x47\xea\xc0\xc7\x95\x45\x0d\x80\x90\x1a\x0b\xc1" +
"\x73\x4e\x84\x19\x6d\x7c\x81\x67\x43\x19\xc8\x5e\x00\xbe\x97\x5d\xcd\x12\x86\x50\x68\xb0\x81\xce\xcb\xe2\xf5\x92" +
"\x96\xbf\xc8\x19\xcb\x7e\x8d\x3b\x22\xd6\x71\xc4\xd1\x96\x64\x6f\xe3\x47\xcf\xae\x39\x6a\x68\x49\x6f\xf5\xec\x47" +
"\x9a\x26\x14\x7f\x28\x8e\xd7\x5c\xee\xcf\x9a\x4f\x33\xab\xaf\xb4\x2d\x89\xef\xf7\xb7\x68\x0f\x3c\xcd\x98\x55\xd5" +
"\xd2\x6c\x16\x45\x53\xc0\x01\x7d\x54\x83\xc0\x0e\x43\xed\x61\xf3\x14\x70\x58\x46\xb4\x6d\x1d\xc7\xde\x0f\x6d\x35" +
"\xa5\xed\xcf\xa1\x79\x2f\x49\x19\xa8\x9e\x05\x6c\xf4\xeb\x91\x78\x2f\x17\xab\xb9\x3d\x99\x25\x3e\x3d\x52\x8f\x29" +
"\xd8\x3d\xfc\xde\xdc\x95\x13\x37\x97\xf7\xe9\x6e\x8f\x53\xf8\xbc\x68\x0a\xec\xde\x8e\x8a\x2e\xc6\xfe\x29\x2f\x1b" +
"\xc3\xc8\xa1\x5b\xbc\xca\xc9\x27\x6d\x55\x11\xd0\x8e\x5c\xca\xb2\xff\x8f\xb6\x7c\x48\xd1\xd6\xd1\x6b\x1a\xb2\xae" +
"\xee\x1a\xf5\x4d\x7c\xb4\x95\x3d\xf5\x81\xd0\xac\x97\x93\xcd\xc9\x0a\x42\xac\x95\x14\x33\x24\x5e\x22\x1e\x19\x10" +
"\x8c\xb4\x64\xe4\xe7\x88\x93\xd5\x4b\xa4\x4b\xf5\x96\x44\x73\x3b\xfe\x16\x8b\x80\xfa\x0e\x94\x6b\x05\xb3\xf0\x20" +
"\x38\xc1\x47\x19\xc6\x0e\x68\xe7\x4d\x9b\x3f\x01\x00\x00\xff\xff\x42\x8c\xc7\xe4\x16\x05\x00\x00")
2016-05-22 13:04:37 +00:00
func bindataHelptxtBytes() ([]byte, error) {
2016-05-22 13:04:37 +00:00
return bindataRead(
_bindataHelptxt,
2016-05-22 13:04:37 +00:00
"help.txt",
)
}
func bindataHelptxt() (*asset, error) {
bytes, err := bindataHelptxtBytes()
2016-05-22 13:04:37 +00:00
if err != nil {
return nil, err
}
info := bindataFileInfo{
name: "help.txt",
size: 1302,
md5checksum: "",
mode: os.FileMode(420),
modTime: time.Unix(1466894900, 0),
}
2016-05-22 13:04:37 +00:00
a := &asset{bytes: bytes, info: info}
2016-05-22 13:04:37 +00:00
return a, nil
}
//
2016-05-22 13:04:37 +00:00
// 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.
//
2016-05-22 13:04:37 +00:00
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, &os.PathError{Op: "open", Path: name, Err: os.ErrNotExist}
2016-05-22 13:04:37 +00:00
}
//
2016-05-22 13:04:37 +00:00
// MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables.
// nolint: deadcode
//
2016-05-22 13:04:37 +00:00
func MustAsset(name string) []byte {
a, err := Asset(name)
if err != nil {
panic("asset: Asset(" + name + "): " + err.Error())
}
return a
}
//
2016-05-22 13:04:37 +00:00
// 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.
//
2016-05-22 13:04:37 +00:00
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, &os.PathError{Op: "open", Path: name, Err: os.ErrNotExist}
2016-05-22 13:04:37 +00:00
}
//
2016-05-22 13:04:37 +00:00
// AssetNames returns the names of the assets.
// nolint: deadcode
//
2016-05-22 13:04:37 +00:00
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
}
//
2016-05-22 13:04:37 +00:00
// _bindata is a table, holding each asset generator, mapped to its name.
//
2016-05-22 13:04:37 +00:00
var _bindata = map[string]func() (*asset, error){
"help.txt": bindataHelptxt,
2016-05-22 13:04:37 +00:00
}
//
2016-05-22 13:04:37 +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
// 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"}.
//
2016-05-22 13:04:37 +00:00
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, &os.PathError{
Op: "open",
Path: name,
Err: os.ErrNotExist,
}
2016-05-22 13:04:37 +00:00
}
}
}
if node.Func != nil {
return nil, &os.PathError{
Op: "open",
Path: name,
Err: os.ErrNotExist,
}
2016-05-22 13:04:37 +00:00
}
rv := make([]string, 0, len(node.Children))
for childName := range node.Children {
rv = append(rv, childName)
}
return rv, nil
}
2016-05-22 13:04:37 +00:00
type bintree struct {
Func func() (*asset, error)
Children map[string]*bintree
}
var _bintree = &bintree{Func: nil, Children: map[string]*bintree{
"help.txt": {Func: bindataHelptxt, Children: map[string]*bintree{}},
2016-05-22 13:04:37 +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
}
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
2016-05-22 13:04:37 +00:00
}
// 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, "/")...)...)
}