vain/sql/static.go

238 lines
6.3 KiB
Go

// Code generated by go-bindata.
// sources:
// sql/init.sql
// DO NOT EDIT!
package sql
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 _sqlInitSql = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x74\x90\xc1\x6e\x83\x30\x10\x44\xef\x7c\xc5\x1c\x41\xea\x1f\xf4\xe4\xc2\x46\x42\x35\x26\x35\x8b\xda\x1c\x5d\xb2\x4d\xa3\x10\x43\x31\xe9\xf7\x57\x0a\x22\x25\x8a\x38\xda\x33\xd2\xbc\xb7\xa9\x25\xc5\x04\x56\x2f\x9a\x70\x09\x32\x04\xc4\x11\x00\xc8\xd9\x1d\x5b\x30\x7d\x30\xb6\x36\x2f\x94\xdd\xe1\x95\x76\x4f\xd7\x6c\xec\x4e\xe2\xa7\xac\x36\xf9\x5b\x4d\xd3\xf7\x20\x87\x63\x18\x65\x90\x3d\x3e\xbb\xae\x15\xe7\x91\xd1\x46\xd5\x9a\xf1\xe5\xda\x20\x73\xeb\xe7\x22\x61\x94\x3d\x38\x2f\xa8\x62\x55\x6c\x61\x4a\x86\xa9\xb5\xbe\xf5\x4d\xf9\x1e\x27\x51\xf2\x1c\x45\x77\x80\xde\x9d\x25\xf4\xae\x91\x99\xd2\x87\x15\xc4\x05\xbe\xa5\x0d\x59\x32\x29\x55\x93\x60\x7c\xcd\x12\x94\x06\x19\x69\x62\x42\xaa\xaa\x54\x65\xf4\xb8\xd7\xbb\xe6\xe4\x0e\xb7\xb5\xdf\x66\x9a\x9b\x45\xfa\x6e\xf1\xec\xdd\xf8\xfd\x78\x93\x19\x70\x01\xf1\x2f\x11\xfb\xb0\x82\xf1\x17\x00\x00\xff\xff\x04\x74\x3c\xff\x97\x01\x00\x00")
func sqlInitSqlBytes() ([]byte, error) {
return bindataRead(
_sqlInitSql,
"sql/init.sql",
)
}
func sqlInitSql() (*asset, error) {
bytes, err := sqlInitSqlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "sql/init.sql", size: 407, mode: os.FileMode(436), modTime: time.Unix(1466486246, 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){
"sql/init.sql": sqlInitSql,
}
// 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{
"sql": &bintree{nil, map[string]*bintree{
"init.sql": &bintree{sqlInitSql, 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, "/")...)...)
}