1
0
Fork 0
mirror of https://github.com/Luzifer/duplicity-backup.git synced 2024-11-14 01:42:52 +00:00
duplicity-backup/bindata.go

236 lines
7.4 KiB
Go
Raw Normal View History

2016-05-22 13:04:37 +00:00
// 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
}
2016-06-25 23:33:28 +00:00
var _helpTxt = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\x94\xb1\x8e\xdb\x30\x0c\x86\x77\x3f\x05\xc7\x76\xf0\xdd\x7e\x5b\x71\x41\xa6\x0e\x45\x8b\xa2\x43\x90\x81\x91\x69\x5b\x38\x45\x32\x28\xea\xae\xc9\xd0\x67\x2f\x65\x29\x89\x2f\xb9\x00\x1d\xca\x2d\x12\xf9\xe9\xcf\x4f\xd2\xbf\x18\xa7\x89\x18\x90\x43\xf2\x1d\x74\x69\x72\xd6\x58\x39\x80\x04\x30\x4c\x28\x04\x3b\x34\x2f\x69\x82\x37\x2b\x23\x38\x8a\x11\x46\x3c\x1e\x1d\x35\xcd\xcf\x88\x03\x3d\x35\x70\xa9\x6a\x6b\xee\xc6\x84\xfd\x1e\x7d\xb7\x6d\x9a\x2f\xaf\x68\x1d\xee\x1c\xc1\x73\x39\x8b\xb9\xa2\xe6\x3d\x82\xf5\x86\xe1\x3a\x9e\xdf\x3d\x8c\xc6\x04\xee\xac\x1f\xb2\x26\x19\xcf\xe7\x9c\x54\x8d\xb2\xfa\xe4\xdc\x0d\xe2\x1c\xeb\xc0\x86\xe2\x5c\x37\xff\x1f\x1b\x3c\x84\x1e\xb0\x94\x15\x94\x42\x8c\x23\xf4\x0a\xfd\x38\x56\xe4\x48\x05\x65\x08\xfd\x16\x46\x4f\x21\xc5\x85\x59\xbd\x2d\x52\x9c\x8d\xd2\x9a\x11\xfd\x40\x5d\x3b\x1f\x2e\x29\x5f\xf5\xb6\x28\x29\x57\x35\x11\xa2\x9a\x40\xe0\x30\xca\x45\x4f\x21\x25\x66\xf2\xf2\x0f\xa4\xe0\x05\xad\x57\x96\xf5\x0b\x8b\x94\xc3\x14\x25\x30\xc1\x26\x27\xc2\x84\x32\x6e\x61\x23\xc8\x03\xc9\x16\xe0\x7b\xb9\x8d\x59\xc2\xe0\x0a\x4d\x9b\xd2\x59\x9e\xbd\x9e\xd3\xf2\x2f\x32\x9a\x76\x58\xe2\xce\x88\x65\x9c\x71\xf4\x4a\x7c\x90\xf1\xd4\xb3\x5b\x4e\x14\x94\x14\xef\xf5\xec\x47\xd2\x49\x61\x7b\x2c\x8e\xd7\x5c\x6d\xda\xb2\xf9\x34\x85\x68\x2b\x4d\x5f\xb3\xfd\xe1\x1e\x4d\xe7\x6e\xc2\xac\xaa\x96\x66\xb3\xd4\xd5\x08\x38\xa8\x67\x6a\xba\x0b\x06\x5d\xed\x61\xb3\x76\x38\xcc\x23\xda\xb6\x9a\xd8\xdb\xa1\xad\xa6\xb4\xfd\x7b\x68\xbe\x4b\x5c\x06\xaa\x0f\x6a\xd8\x68\x97\x23\xf1\x56\x16\xab\xb9\xa7\xea\x14\x9f\x56\xd4\x63\x72\xf2\x04\x7f\x1e\x1f\xca\x8b\x8f\xd7\xfb\xf4\x70\xc0\xbd\xfb\x3c\x6b\x52\xad\x2f\x67\x45\x57\x63\xbf\xce\xc7\xea\xf7\x18\x5c\x37\x7b\x95\x93\x2f\xda\xaa\x22\x9d\x60\x32\x29\xcb\xfe\x3f\xda\xf2\x23\x45\x5b\x47\xbb\x34\x64\x5d\xdd\x2d\xea\x1b\x5b\x2f\x0b\x7b\xea\x07\x22\x66\xbd\x21\xc9\x94\xa4\x20\x58\x5a\x4e\x3e\x43\xfc\x35\x62\x15\x74\x6b\x45\x47\x6c\xce\xc8\x9f\x23\x2d\xac\x4b\x14\xe7\x6a\x9d\x83\x98\xdb\xf1\x51\xcc\x02\xea\x77\xa0\xac\x15\x4c\x1c\x06\xc6\x3d\x9c\xca\x54\x8f\x9a\x63\x25\x36\x7f\x03\x00\x00\xff\xff\x42\x8c\xc7\xe4\x16\x05\x00\x00")
2016-05-22 13:04:37 +00:00
func helpTxtBytes() ([]byte, error) {
return bindataRead(
_helpTxt,
"help.txt",
)
}
func helpTxt() (*asset, error) {
bytes, err := helpTxtBytes()
if err != nil {
return nil, err
}
2016-06-25 23:33:28 +00:00
info := bindataFileInfo{name: "help.txt", size: 1302, mode: os.FileMode(420), modTime: time.Unix(1466894900, 0)}
2016-05-22 13:04:37 +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){
"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, "/")...)...)
}