2019-09-04 06:25:33 +00:00
|
|
|
// Code generated by go-bindata. DO NOT EDIT.
|
|
|
|
// sources:
|
2019-09-04 18:23:17 +00:00
|
|
|
// 0001_app.down.sql (344B)
|
|
|
|
// 0001_app.up.sql (2.701kB)
|
2019-09-04 06:25:33 +00:00
|
|
|
// doc.go (74B)
|
|
|
|
|
2019-07-25 05:35:09 +00:00
|
|
|
package migrations
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"compress/gzip"
|
2019-09-04 06:25:33 +00:00
|
|
|
"crypto/sha256"
|
2019-07-25 05:35:09 +00:00
|
|
|
"fmt"
|
|
|
|
"io"
|
2019-09-04 06:25:33 +00:00
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
2019-07-25 05:35:09 +00:00
|
|
|
"strings"
|
2019-09-04 06:25:33 +00:00
|
|
|
"time"
|
2019-07-25 05:35:09 +00:00
|
|
|
)
|
|
|
|
|
2019-09-04 06:25:33 +00:00
|
|
|
func bindataRead(data []byte, name string) ([]byte, error) {
|
2019-07-25 05:35:09 +00:00
|
|
|
gz, err := gzip.NewReader(bytes.NewBuffer(data))
|
|
|
|
if err != nil {
|
2019-09-04 06:25:33 +00:00
|
|
|
return nil, fmt.Errorf("read %q: %v", name, err)
|
2019-07-25 05:35:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var buf bytes.Buffer
|
|
|
|
_, err = io.Copy(&buf, gz)
|
2019-09-04 06:25:33 +00:00
|
|
|
clErr := gz.Close()
|
2019-07-25 05:35:09 +00:00
|
|
|
|
|
|
|
if err != nil {
|
2019-09-04 06:25:33 +00:00
|
|
|
return nil, fmt.Errorf("read %q: %v", name, err)
|
|
|
|
}
|
|
|
|
if clErr != nil {
|
|
|
|
return nil, err
|
2019-07-25 05:35:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return buf.Bytes(), nil
|
|
|
|
}
|
|
|
|
|
2019-09-04 06:25:33 +00:00
|
|
|
type asset struct {
|
|
|
|
bytes []byte
|
|
|
|
info os.FileInfo
|
|
|
|
digest [sha256.Size]byte
|
|
|
|
}
|
|
|
|
|
|
|
|
type bindataFileInfo struct {
|
|
|
|
name string
|
|
|
|
size int64
|
|
|
|
mode os.FileMode
|
|
|
|
modTime time.Time
|
|
|
|
}
|
2019-07-25 05:35:09 +00:00
|
|
|
|
2019-09-04 06:25:33 +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) IsDir() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
func (fi bindataFileInfo) Sys() interface{} {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-09-04 18:23:17 +00:00
|
|
|
var __0001_appDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\xce\xbd\x0e\xc2\x30\x0c\x04\xe0\xbd\x4f\xd1\xf7\xe8\x04\x6a\x07\x24\x04\x08\x31\xb0\x59\x21\x35\xad\x45\x1b\x07\xdb\xe5\xe7\xed\xd9\x80\x40\xba\x7e\x77\x3a\x5d\xbd\xdf\xee\xca\xc3\x62\xb9\x6e\x4a\x45\x33\x0a\x9d\x56\xc5\x17\x3a\xef\x79\x0a\x96\xe2\x49\xf8\xae\x28\x79\x84\x9e\xd4\x58\x9e\x49\xd8\xba\x18\xd3\x7a\x44\x19\x49\x95\x38\xa4\x6e\xe2\x82\x9e\xff\xc6\x07\xf6\x97\xfc\x33\x30\x86\x4c\x3c\x3a\x1a\x14\xe5\xf6\xbb\xf4\x71\x10\xbc\x4e\xa8\x06\x9d\x7b\x7f\x5b\x6d\xea\xe6\x38\xd7\x01\xdf\x3b\x03\x6a\x81\xda\xc7\xdc\xa6\x71\x24\xaf\x55\xf1\x0a\x00\x00\xff\xff\x89\xe0\x6b\xf0\x58\x01\x00\x00")
|
2019-09-04 06:25:33 +00:00
|
|
|
|
|
|
|
func _0001_appDownSqlBytes() ([]byte, error) {
|
|
|
|
return bindataRead(
|
|
|
|
__0001_appDownSql,
|
2019-07-25 05:35:09 +00:00
|
|
|
"0001_app.down.sql",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2019-09-04 06:25:33 +00:00
|
|
|
func _0001_appDownSql() (*asset, error) {
|
|
|
|
bytes, err := _0001_appDownSqlBytes()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2019-07-25 05:35:09 +00:00
|
|
|
|
2019-09-04 18:23:17 +00:00
|
|
|
info := bindataFileInfo{name: "0001_app.down.sql", size: 344, mode: os.FileMode(0644), modTime: time.Unix(1567620215, 0)}
|
|
|
|
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa0, 0x74, 0x22, 0xcd, 0xfd, 0xf3, 0xf1, 0x2a, 0xa0, 0xc1, 0x37, 0x66, 0x32, 0x93, 0x2c, 0x75, 0x21, 0xd6, 0xd7, 0xb2, 0x37, 0x7c, 0x2, 0x4c, 0xab, 0xab, 0x4c, 0x5d, 0x55, 0x6c, 0x77, 0xf2}}
|
2019-09-04 06:25:33 +00:00
|
|
|
return a, nil
|
|
|
|
}
|
|
|
|
|
2019-09-04 18:23:17 +00:00
|
|
|
var __0001_appUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x56\xc1\x92\xaa\x3a\x10\xdd\xf3\x15\xbd\xd4\x2a\x36\x6f\x3d\x2b\xd4\xe8\x50\x8f\x07\xef\x22\xde\x99\x59\xa5\x22\x44\xa5\x04\x92\x49\xe2\x38\xfe\xfd\xad\x00\x01\x54\xc0\xb1\xee\x8e\xa4\x3b\xc7\x73\x4e\x77\x3a\xce\x43\xe4\x44\x08\x22\x67\xe6\x21\x70\x97\xe0\x07\x11\xa0\x77\x77\x1d\xad\x41\x52\xa5\xd2\x62\x2f\x61\x62\xa9\x0b\xa7\xf0\xdb\x09\xe7\xaf\x4e\x08\xff\x87\xee\x7f\x4e\xf8\x01\xff\xa2\x0f\xdb\xfa\x22\xd9\x89\xc2\xcc\x0b\x66\xd6\x14\xde\xdc\xe8\x35\xd8\x44\x10\x06\x6f\xee\xe2\xc5\xb2\x46\xc0\x49\x1c\xb3\x53\xa1\x34\x38\x49\x12\x41\xa5\xec\xc7\x3f\x93\x2c\xa3\x0a\x66\x41\xe0\x21\xc7\xb7\xad\xf8\x40\x3a\xab\x92\x57\x84\xde\x23\xdb\x92\x8a\x09\xb2\x37\x2b\x7e\xda\x1e\xe9\xa5\xe4\x65\x5b\x9c\xa8\x43\xbd\x5f\x90\xdc\xa4\xc4\x2c\x63\xa2\xfc\x1e\x66\xbe\xf1\xdd\x5f\x1b\x04\xae\xbf\x40\xef\x70\x2a\xd2\xcf\x13\xc5\x15\x23\x6c\x58\x07\x7e\x47\x4b\x15\x9b\xc2\xdb\x2b\x0a\x51\xb3\x7c\x19\x83\xd3\x82\xfa\xc1\x74\xa4\x81\x2a\x17\xe3\x96\x6e\x05\x3b\x4b\x2a\xb4\xa5\x69\x52\x0a\xbb\xb6\xb2\xd1\x5e\x1e\xf2\x37\x9e\x67\x5b\x2a\xcd\xa9\x54\x24\xe7\xb0\x59\xaf\xdc\x95\x8f\x16\x30\x73\x57\xae\x1f\xd9\x56\x42\x38\x37\x4e\xc3\x02\x2d\x9d\x8d\x17\xc1\x8e\x64\x92\xda\xd6\x21\xd5\x76\x5f\xdc\x22\xa1\xdf\xb0\xf1\xd7\xd5\x49\xd7\x1f\xb1\x72\x8c\x31\xae\xf1\x60\x62\xd5\x5b\xd8\x28\x68\xa9\x9a\x9c\xaa\x7a\xcb\x20\x44\xee\xca\xd7\xca\x26\xed\x99\x29\x84\x68\x89\x42\xe4\xcf\x51\x8b\x3e\xd1\xfb\x81\xd6\xe0\xa1\x08\xc1\xdc\x59\xcf\x9d\x05\xb2\x1e\xb8\xa9\xe5\x6b\x2b\x5b\xd7\x3a\x66\x3e\x27\x93\x53\x91\xa7\x52\xa6\xac\xd0\x80\x1a\x18\xf7\xd5\xa2\x4d\xbb\x8d\x74\xc5\x36\xc7\xaf\xb4\x96\x6c\x27\xd5\x76\xbf\xd4\x31\x82\x4a\x90\x42\xee\xaa\xd6\x29\xa8\x3a\x33\x71\xd4\x05\x68\x0a\x5b\xb5\x44\xb7\x16\x44\x1e\x9a\xfb\xda\x6e\xdf\xde\xe4\x36\xb2\xcd\x8e\x78\xe0\x90\xfa\xae\xaf\xa9\xa4\x45\x42\x45\x4f\x86\xa0\x31\x4d\xb9\xaa\xd3\x32\xb6\xaf\xbf\xae\xa6\x52\xbf\x5b\xad\x1a\xdb\x50\xb8\xee\x91\x8c\xc5\x47\xd9\x4d\xab\x52\xee\x3c\xb4\xad\x79\xe0\xaf\xa3\xd0\xd1\x46\xd4\x57\xd7\xd8\x86\x39\x15\xe6\x0a\x97\xdf\x35\x9c\xb9\xef\x13\x8d\x69\xd7\x09\x76\xfb\x5b\xd3\x47\x3d\x58\xb1\xfb\xcb\xa2\x14\xa7\x7c\x4b\xc5\x7d\x7a\xe7\xea\x0f\x43\x52\x92\x94\x33\xa0\x19\x00\x4b\xc7\x5b\xf7\x9a\x51\x72\xed\x55\x7f\x6b\xee\xe0\xe1\x8a\xe9\x23\x8c\x2a\xeb\xa1\x77\x66\x8e\x62\xc5\xf0\x73\x3e\x8e\x77\xf1\x90\x9d\xf2\x52\xc4\x50\x0e\xce\x91\xfe\xab\xb9\x8f\x77\xa0\x49\xfa\x51\x0f\xe6\x84\xf3\xb4\xd8\xe3\x1d\x13\xb8\x96\xdc\x28\xee\x75\xd2\xb4\x61\x4b\xe7\x99\x8e\xcc\x49\x9a\x49\x2a\xbe\xaa\x59\x01\x00\x90\x26\xfd\x0f\xb7\x8e\x95\x53\xee\xde\x46\x1d\x1a\x36\x59\x47\x39\x91\xf2\xcc\x44\x03\x5d\xed\xee\x32\x4a\xd5\xdd\x89\xe7\x66\x71\x2b\x00\x0b\xfa\x79\xa2\x52\xe1\x3d\xe1\x46\xcc\x9e\x70\xbc\x13\x2c\xbf\x7a\xd3\xd0\x0a\xdd\xf2\xd3\x79\x8a\x3d\xca\xea\x7d\x85\x75\xa0\x7c\xf3\x6f\x5f\xb8\x61\x1d\xd5\xff\x85\x01\xe6\xb8\x06\xc3\x69\xf2\xad\x5b\x66\x50\x60\x9d\xf7\xe3\x02\x63\xc5\x78\x1a\x1b\x67\xca\xc5\x70\xa5\x6b\x70\x79\x5d\xb0\x8c\x48\x65\x58\x34\x1e\x99\x49\xf2\xcf\xbd\xe0\x3f\x01\x00\x00\xff\xff\xa9\x9c\x70\x28\x8d\x0a\x00\x00")
|
2019-09-04 06:25:33 +00:00
|
|
|
|
|
|
|
func _0001_appUpSqlBytes() ([]byte, error) {
|
|
|
|
return bindataRead(
|
|
|
|
__0001_appUpSql,
|
2019-07-25 05:35:09 +00:00
|
|
|
"0001_app.up.sql",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2019-09-04 06:25:33 +00:00
|
|
|
func _0001_appUpSql() (*asset, error) {
|
|
|
|
bytes, err := _0001_appUpSqlBytes()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2019-09-04 18:23:17 +00:00
|
|
|
info := bindataFileInfo{name: "0001_app.up.sql", size: 2701, mode: os.FileMode(0644), modTime: time.Unix(1567620191, 0)}
|
|
|
|
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x36, 0xdf, 0xa0, 0x6b, 0x3f, 0x6a, 0x1, 0xa, 0x8, 0xae, 0x78, 0xe5, 0xea, 0x9c, 0x51, 0xcf, 0xef, 0x46, 0x16, 0xad, 0xa0, 0xc6, 0x98, 0xb4, 0xd1, 0xd2, 0xbd, 0x18, 0x1f, 0xe0, 0x16, 0x8f}}
|
2019-09-04 06:25:33 +00:00
|
|
|
return a, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var _docGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\xc9\xb1\x0d\xc4\x20\x0c\x05\xd0\x9e\x29\xfe\x02\xd8\xfd\x6d\xe3\x4b\xac\x2f\x44\x82\x09\x78\x7f\xa5\x49\xfd\xa6\x1d\xdd\xe8\xd8\xcf\x55\x8a\x2a\xe3\x47\x1f\xbe\x2c\x1d\x8c\xfa\x6f\xe3\xb4\x34\xd4\xd9\x89\xbb\x71\x59\xb6\x18\x1b\x35\x20\xa2\x9f\x0a\x03\xa2\xe5\x0d\x00\x00\xff\xff\x60\xcd\x06\xbe\x4a\x00\x00\x00")
|
2019-07-25 05:35:09 +00:00
|
|
|
|
2019-09-04 06:25:33 +00:00
|
|
|
func docGoBytes() ([]byte, error) {
|
|
|
|
return bindataRead(
|
|
|
|
_docGo,
|
2019-07-25 05:35:09 +00:00
|
|
|
"doc.go",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2019-09-04 06:25:33 +00:00
|
|
|
func docGo() (*asset, error) {
|
|
|
|
bytes, err := docGoBytes()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2019-09-04 18:23:17 +00:00
|
|
|
info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1566753968, 0)}
|
2019-09-04 06:25:33 +00:00
|
|
|
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x7c, 0x28, 0xcd, 0x47, 0xf2, 0xfa, 0x7c, 0x51, 0x2d, 0xd8, 0x38, 0xb, 0xb0, 0x34, 0x9d, 0x4c, 0x62, 0xa, 0x9e, 0x28, 0xc3, 0x31, 0x23, 0xd9, 0xbb, 0x89, 0x9f, 0xa0, 0x89, 0x1f, 0xe8}}
|
|
|
|
return a, nil
|
|
|
|
}
|
|
|
|
|
2019-07-25 05:35:09 +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.
|
|
|
|
func Asset(name string) ([]byte, error) {
|
2019-09-04 06:25:33 +00:00
|
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
|
|
|
if f, ok := _bindata[canonicalName]; 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
|
2019-07-25 05:35:09 +00:00
|
|
|
}
|
|
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
|
|
|
}
|
|
|
|
|
2019-09-04 06:25:33 +00:00
|
|
|
// AssetString returns the asset contents as a string (instead of a []byte).
|
|
|
|
func AssetString(name string) (string, error) {
|
|
|
|
data, err := Asset(name)
|
|
|
|
return string(data), err
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|
|
|
|
|
|
|
|
// MustAssetString is like AssetString but panics when Asset would return an
|
|
|
|
// error. It simplifies safe initialization of global variables.
|
|
|
|
func MustAssetString(name string) string {
|
|
|
|
return string(MustAsset(name))
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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) {
|
|
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
|
|
|
if f, ok := _bindata[canonicalName]; 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)
|
|
|
|
}
|
|
|
|
|
|
|
|
// AssetDigest returns the digest of the file with the given name. It returns an
|
|
|
|
// error if the asset could not be found or the digest could not be loaded.
|
|
|
|
func AssetDigest(name string) ([sha256.Size]byte, error) {
|
|
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
|
|
|
if f, ok := _bindata[canonicalName]; ok {
|
|
|
|
a, err := f()
|
|
|
|
if err != nil {
|
|
|
|
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err)
|
|
|
|
}
|
|
|
|
return a.digest, nil
|
|
|
|
}
|
|
|
|
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Digests returns a map of all known files and their checksums.
|
|
|
|
func Digests() (map[string][sha256.Size]byte, error) {
|
|
|
|
mp := make(map[string][sha256.Size]byte, len(_bindata))
|
|
|
|
for name := range _bindata {
|
|
|
|
a, err := _bindata[name]()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
mp[name] = a.digest
|
|
|
|
}
|
|
|
|
return mp, nil
|
|
|
|
}
|
|
|
|
|
2019-07-25 05:35:09 +00:00
|
|
|
// 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.
|
2019-09-04 06:25:33 +00:00
|
|
|
var _bindata = map[string]func() (*asset, error){
|
|
|
|
"0001_app.down.sql": _0001_appDownSql,
|
|
|
|
|
|
|
|
"0001_app.up.sql": _0001_appUpSql,
|
|
|
|
|
|
|
|
"doc.go": docGo,
|
2019-07-25 05:35:09 +00:00
|
|
|
}
|
2019-09-04 06:25:33 +00:00
|
|
|
|
2019-07-25 05:35:09 +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
|
2019-09-04 06:25:33 +00:00
|
|
|
// 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, and
|
2019-07-25 05:35:09 +00:00
|
|
|
// AssetDir("") will return []string{"data"}.
|
|
|
|
func AssetDir(name string) ([]string, error) {
|
|
|
|
node := _bintree
|
|
|
|
if len(name) != 0 {
|
2019-09-04 06:25:33 +00:00
|
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
|
|
|
pathList := strings.Split(canonicalName, "/")
|
2019-07-25 05:35:09 +00:00
|
|
|
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))
|
2019-09-04 06:25:33 +00:00
|
|
|
for childName := range node.Children {
|
|
|
|
rv = append(rv, childName)
|
2019-07-25 05:35:09 +00:00
|
|
|
}
|
|
|
|
return rv, nil
|
|
|
|
}
|
|
|
|
|
2019-09-04 06:25:33 +00:00
|
|
|
type bintree struct {
|
|
|
|
Func func() (*asset, error)
|
|
|
|
Children map[string]*bintree
|
2019-07-25 05:35:09 +00:00
|
|
|
}
|
2019-09-04 06:25:33 +00:00
|
|
|
|
|
|
|
var _bintree = &bintree{nil, map[string]*bintree{
|
|
|
|
"0001_app.down.sql": &bintree{_0001_appDownSql, map[string]*bintree{}},
|
|
|
|
"0001_app.up.sql": &bintree{_0001_appUpSql, map[string]*bintree{}},
|
|
|
|
"doc.go": &bintree{docGo, map[string]*bintree{}},
|
2019-07-25 05:35:09 +00:00
|
|
|
}}
|
2019-09-04 06:25:33 +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())
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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 {
|
|
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
|
|
|
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...)
|
|
|
|
}
|