2021-04-18 15:41:13 -04:00
|
|
|
// Copyright (c) 2015-2021 MinIO, Inc.
|
|
|
|
//
|
|
|
|
// This file is part of MinIO Object Storage stack
|
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU Affero General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2020-10-04 13:18:46 -04:00
|
|
|
// Code generated by go-bindata.
|
|
|
|
// sources:
|
|
|
|
// drivedb.yaml
|
|
|
|
// DO NOT EDIT!
|
|
|
|
|
|
|
|
package smart
|
|
|
|
|
|
|
|
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 _drivedbYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\x6b\x97\xa2\xc8\xb6\x28\xfa\x7d\xff\x8a\x38\xeb\x9c\x7d\x17\xf4\x59\x9a\xf1\x00\xc4\xbe\x1f\x72\x20\xf8\xca\x14\xd3\x16\xcc\xca\x2e\xdb\xe1\xa0\x94\xcc\xe4\x96\x29\xb9\x11\xeb\xb1\x76\xec\xff\x7e\x47\x04\xa0\x20\x28\x98\x99\xd5\x55\xbd\x56\xf5\x18\x9d\x5a\xc2\x7c\x44\xc4\x8c\xf9\x88\x98\x31\xe3\x7f\x03\xfb\xd1\xdb\x80\x7b\x6f\xe5\x82\xcf\xce\x06\x3c\xb8\x6b\x37\x70\x42\x77\x09\xee\x03\xff\xe9\xd7\xff\xf8\xdf\xe0\x3f\xfe\x37\x58\x06\xde\x27\x77\xf9\xa1\xfe\x08\x6a\x60\xf3\xe4\x04\xe1\x93\xbf\x0e\x7d\x7f\xb5\x89\x9e\x80\xa5\x13\x3a\x1f\x9c\x8d\xcb\xd1\x44\x20\x3d\xff\xc9\x05\xcf\xce\x83\x0b\xfc\x7b\xb0\xf0\x97\x2e\xf0\x36\xbf\x82\xc7\x30\x7c\xde\xfc\x7a\x71\xf1\xf9\xf3\xe7\x7a\x06\x51\xdd\x0f\x1e\x22\x40\xdd\x7f\xfe\x1a\x78\x0f\x8f\x21\x10\x74\x11\x60\x08\x49\x0d\x21\x30\x7a\xf4\x56\xde\x33\x78\xe7\xad\x56\x9e\xf3\xb4\xf9\x07\x68\x05\xdb\x85\x0b\xb4\xd5\xca\x5d\x17\x01\xa9\x35\x0c\x81\xfe\x18\x78\x9b\xd0\x73\xd6\xa0\x13\x38\xeb\x8f\x31\x67\xd6\xc8\xb8\xab\x0d\xbc\x85\xbb\xde\xb8\xb5\xfe\xd2\x5d\x87\xde\xbd\xe7\x06\xbf\x82\xee\x68\x50\xc3\x75\x58\xf3\x83\xda\xca\x09\xdd\x80\xbd\xce\xdb\xb7\xf9\xf5\x3f\x6a\xe0\xde\x79\xf2\x56\x5f\x7f\x05\x7f\xff\x3f\xfd\xe5\xaf\xa9\x1e\x91\xa1\xaa\x00\x0c\x31\xac\xc1\x26\x23\x8a\xe4\x5f\x25\xf9\x57\x09\xbd\x07\x8b\xc7\xe0\x9e\xd3\x05\xff\xe7\xef\xff\x01\xc0\x93\xbf\x74\x57\xf3\xc0\x7d\x70\xbf\xfc\x0a\xfe\x5e\x63\x3f\xdd\x7b\xc1\xd3\x67\x27\x70\xb3\xbf\x7e\x76\x82\xb5\xb7\x7e\xf8\x35\x1a\x19\x6f\x03\x1c\xb0\xdc\x3e\x3d\x7d\x05\xee\x3a\x0c\xbe\x82\xd0\x07\x8f\xfe\x6a\x09\xc2\x47\x17\x58\xb7\xc3\x5a\x7f\xc9\xba\x78\xc7\x50\x8a\x55\xa3\xdd\xd1\x26\x03\xfb\x45\xb4\x0d\xf7\xde\xd9\xae\x42\xb0\x71\xc3\xd0\x5b\x3f\x6c\xfe\x03\x80\xe7\xc0\xdd\xb8\xe1\xe6\xd7\xff\x00\x00\x80\xbf\xa1\xbf\x45\x5f\x00\x58\xf8\xeb\x4f\xbf\x82\xc0\xf9\x2c\xa9\xf1\x2f\x6b\xe7\xc9\xfd\x15\x8c\x9d\xcf\xf3\xb1\xeb\x2c\xe7\xed\x20\xf0\x83\xf9\xd8\x09\xdd\x08\x14\x97\x82\xda\x8f\x81\xbf\x7d\x78\x7c\xde\x86\xf3\x91\x1b\xdc\xfb\xc1\x93\xb3\x5e\xc4\xd0\x24\x0f\x8d\x14\xc1\xf9\xf4\x80\x14\x31\x83\xc4\x7a\xf6\xd6\xf3\xc9\xf3\xdc\xf6\x9e\x62\x50\xa9\x94\xb0\x15\x3a\x41\x38\xb7\x42\xff\x79\xae\xfb\xdb\x75\x18\xc1\xc9\x85\x24\xf9\xdf\x2c\xc9\xb1\xeb\xac\x56\xfe\x82\xcd\x9f\xb9\xe5\x2e\x42\x3f\x98\xeb\x31\x0e\xa5\xbc\xbf\x58\x5f\xe9\x8f\xce\x7a\xed\xae\xe6\xa6\x13\x3c\x78\xeb\x08\xb4\x51\xce\xb6\xeb\x7e\xcc\x75\xb3\x5a\x0d\x8c\x75\x4f\xbe\x97\x9b\x79\x60\x2c\xb1\x26\xab\xd9\x16\x8f\xfc\xcf\x6e\x30\xbf\x59\xcf\x7b\xfe\x36\xd8\xc4\xa2\x01\xcb\x29\xb3\xb1\x19\xbb\x61\xf0\x35\xdd\xcf\xa8\x5c\xa8\x74\x67\xe5\x7d\x08\x9c\xd0\xf3\x8b\xe0\xcb\x25\x2b\xe2\x57\xff\xba\x58\xb9\x19\xc8\x02\xa9\x2a\x1a\x1e\xcb\xbf\x0f\x73\x1d\x8d\x1a\x05\x02\x72\x48\x37\xf0\x1f\x02\xe7\x69\xde\x71\xbc\x55\x44\x78\xae\x3f\x7a\xcf\x09\x82\x72\xe9\x68\x07\xce\xc6\x3d\x06\x5e\x2e\x21\xef\x5c\x27\x98\x0f\xdc\x4f\xee\xca\x5b\x3f\x64\x5a\xde\x28\x97\x93\xc9\xc6\x5d\xce\xc7\x9b\x4f\xcb\x79\x6b\xf5\x71\xae\x1f\x10\x2f\x10\x95\x52\x78\xdb\x4f\xc8\xab\xe5\xc2\x32\x59\x6f\x4f\x21\x28\x17\x9a\x6c\xe7\x47\xd0\xce\x2a\x81\x2f\x17\x9a\x5c\xdf\x67\xe0\x2b\x88\xce\x76\x1d\xb2\x59\xd6\x72\x58\x03\xfc\xc5\xc7\x04\xb4\x5c\x21\xb5\xd7\xcb\x5a\xe8\xd7\xda\xeb\x58\x8d\x26\x90\xe5\x23\x3e\x76\x9f\xfd\x80\x29\xa2\xc9\x7a\xe1\x07\x81\xbb\xd8\x75\x58\xf9\x80\xeb\xfe\xd3\x93\xb3\x5e\x72\xdd\xe0\x6f\x77\x80\xe5\x23\xdd\xf3\x1e\x1e\xe7\x9d\xd5\xd7\xf9\xbb\xc0\x0b\xdd\x44\x1f\x34\x0f\xc7\x38\x74\x9f\x9e\x9f\xbc\xf5\x93\xf3\x25\x03\xad\x79\xc1\xfd\xca\xff\x3c\xb7\xdd\xa7\x67\xe6\x85\x6c\x03\x77\xae\xbb\x49\x47\x37\xcb\x07\xba\x5b\xb3\x98\x59\xcf\xcf\xd0\x66\x45\xcd\x50\xbb\xb9\xbf\xe7\x7a\xc5\x59\x84\x99\x59\xd2\x2c\x1f\xe5\x81\xcf\xf4\x77\x4e\xb3\x34\x0f\x07\xf9\x48\xe3\x0f\x1a\xbd\xf1\xb6\xbb\xee\x2b\x57\x2f\x3d\x27\x58\x72\x6b\xde\xd6\xf5\xf9\xd8\x5d\xf8\x9f\xdc\xc0\x5d\x26\xf0\x05\xda\xa5\xdc\x7e\xb5\x3f\xb9\xeb\x83\x3e\x28\x17\x3a\x7d\x1b\x04\x0c\x6c\xe4\xae\x97\x4c\xd1\x44\x46\x30\x81\x2f\x17\xbc\x9b\xfb\xfb\x95\xb7\x76\xf7\x32\xeb\x7c\x58\xed\xc6\xb0\x82\xa2\x31\x4c\x6d\xae\x8f\xf5\x58\x00\x52\xcc\x63\x58\xae\x67\xcc
|
|
|
|
|
|
|
|
func drivedbYamlBytes() ([]byte, error) {
|
|
|
|
return bindataRead(
|
|
|
|
_drivedbYaml,
|
|
|
|
"drivedb.yaml",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func drivedbYaml() (*asset, error) {
|
|
|
|
bytes, err := drivedbYamlBytes()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
info := bindataFileInfo{name: "drivedb.yaml", size: 150595, mode: os.FileMode(436), modTime: time.Unix(1601091847, 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){
|
|
|
|
"drivedb.yaml": drivedbYaml,
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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{
|
|
|
|
"drivedb.yaml": {drivedbYaml, 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, "/")...)...)
|
|
|
|
}
|