1
0
mirror of https://github.com/Luzifer/duplicity-backup.git synced 2024-09-19 16:32:55 +00:00
duplicity-backup/bindata.go

236 lines
7.4 KiB
Go

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